Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install https

Hopefully a simple question, npm install http works fine and I can connect via port 80 to third party services. npm install https by contrast does not latch on to a recognized package

Though I see a reference to package https here:

HTTP GET Request in Node.js Express

What's the https analog to package http in node.js / Express?

like image 625
prototype Avatar asked Aug 19 '12 16:08

prototype


People also ask

How do I enable HTTPS in node JS?

To built an HTTPS server with nodeJs, we need an SSL (Secure Sockets Layer) certificate. We can create a self-signed SSL certificate on our local machine. Let's first create an SSL certificate on our machine first. After running this command, we would get some options to fill.

How do I install HTTP?

Open a command prompt: Run as Administrator. Navigate to directory c:/Apache24/bin. Add Apache as a Windows Service: httpd.exe -k install -n "Apache HTTP Server"

Is HTTPS built into node?

Node has in-built modules including http, https, and http2 that provide methods to implement and work with different HTTP protocols.


1 Answers

So Node itself has both modules to create a http server and an https server:

  • HTTP http://nodejs.org/api/all.html#all_http
  • HTTPS http://nodejs.org/api/all.html#all_https

Meaning you don't need NPM to get those working, they exist even before NPM itself.

On the other hand NPM will give you access to those great modules/framework.

Express is a framework based on connect blabla... it is awesome to make API or Website as long as you are not looking for a full coffee maker framework. There are a few built on top of Express like railways.js

Request to make HTTP ou HTTPS queries. Request is awesome, it keeps getting better and is today by far the best tool to grab any web content from a node app. If what you are looking for is to do a scraper you may want to look at cheerio.

PS: I took the time to give a good answer. But you should know that the best quality of a developer is to be able to read the docs rather than cry from help without even looking at the doc. My two cents.

like image 99
3on Avatar answered Oct 08 '22 14:10

3on