const express = require("express");
const app = express();
const https = require("https");
app.get("/", function (req, res){
var url = "https://***";
https.get(url, function(response){
console.log(response);
});
res.send("server running");
});
Asked
Active
Viewed 169 times
0
2 Answers
0
Express is really just a layer on top of http. I reckon those following links might help you out, this question has been asked.

Laureline
- 167
- 4
- 5
0
app.get()
registers a listener for a specific INCOMING http request path on a local Express server.
https.get()
makes an OUTBOUND https request TO some other https server to fetch content from that other server.
And, obviously, the https.get()
is using https, not http. The app.get()
could be listening for either - it depends upon how the server it is part of is started (as an http server or an https server) which the code you have in your question does not show.

jfriend00
- 683,504
- 96
- 985
- 979