I'm trying to make a simple hello world kind of server using Express. Here goes my code:
const express = require("express"); const app = express(); app.get("/",function(request, response){//what to do when someone make get request to the homepage or route console.log(request); response.send("hello"); }); app.listen(3000, function(){ console.log("server is listening at port 3000"); }); When I run the program I see this at the command prompt:
server is listening at port 3000
But when I'm accessing it through a browser i.e. https://localhost:3000, I'm getting an error:
This site can’t provide a secure connection localhost sent an invalid response. Try running Windows Network Diagnostics. ERR_SSL_PROTOCOL_ERROR
I expect the browser to see hello as per my method, above, response.send("hello")
http://localhost:3000