14

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?

Community
  • 1
  • 1
prototype
  • 7,249
  • 15
  • 60
  • 94

1 Answers1

26

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

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.

Adi Inbar
  • 12,097
  • 13
  • 56
  • 69
3on
  • 6,291
  • 3
  • 26
  • 22
  • Aha, thanks! I made a typo which made me think it wasn't finding the package. Amazing how its hard to see one's one code. Your answer got me looking close enought. – prototype Aug 19 '12 at 16:32
  • Seriously I got a down vote for this answer... sometime I feel like certain person really deserved a big old fashion RTFM. – 3on Aug 20 '12 at 08:33
  • 1
    Hm, I voted it up and accepted it. I see it at 2 curently. I for one greatly appreciate the hint which got me out of temporary blindness. – prototype Aug 20 '12 at 17:17
  • And am building in Request, which is elegant. So thanks again. – prototype Aug 20 '12 at 17:18
  • You are welcome just a random guy voted it down whatever I know this is not you. Just WTF I feel like I gave the ultimate answer :D Hf with request and use cheerio or jsdom if you ever need to scrap and them you will fall in love with Node. – 3on Aug 20 '12 at 17:24
  • Does it make any difference if I use `http` and open the website with `https` (without using https package)? – BrunoLM Sep 21 '17 at 18:29