0

I built an application with express of node.js.

const express = require('express');  // servidor de desenvolvimento
const app = express();

app.listen(3000, () => {
    console.log(`http://localhost:3000`);
});

when I run the server and try access it with https://my_local_IP:port in browser I get ERR_SSL_PROTOCOL_ERROR, but if I use https://my_local_IP:port it works.

How do I make the app to listen in on http port, even to requests in https port?

rmlockerd
  • 3,776
  • 2
  • 15
  • 25

1 Answers1

0

You'll need an SSL certificate on the server you're running express on. You can check out this answer for more information on how to do that

SomeDeveloper
  • 38
  • 1
  • 5
  • thanks, bro. i found the answer [here](https://stackoverflow.com/questions/21397809/create-a-trusted-self-signed-ssl-cert-for-localhost-for-use-with-express-node) – lk fatllo Aug 14 '21 at 19:54