0

When im using MEAN stack, I always needs to visit the url like

example.com:3000

How do I remove the port in the url?

To:

example.com
iSkore
  • 7,394
  • 3
  • 34
  • 59
maria
  • 207
  • 5
  • 22
  • 56
  • @iSkore im using Mean stack, that includes express. what is the default port i need to change it to? – maria Aug 22 '16 at 17:47

2 Answers2

1

Swap your port to listen to port 80

HTTP is 80

HTTPS is 443

Example:

const express = require( 'express' ),
      app = express();

app.get( '/', function( req, res ) {
    res.send( 'hello world' );
} );

app.listen( 80 );
iSkore
  • 7,394
  • 3
  • 34
  • 59
0

If you would like to change the domain that you access the website with you can add that domain to your hosts file in addition to changing the port to 80. See here: https://stackoverflow.com/a/33682007/3753389

Community
  • 1
  • 1