Search code examples
node.jsexpressloopbackjs

How can I run loopback application on port 80


I'm using loopback.io which base on expressjs and I tried to add port as the first parameter of app.listen like this:

// server.js

app.start = function() {
  // start the web server
  return app.listen(80, function() {
    app.emit('started');
    console.log('Web server listening at: %s', app.get('url'));
  });
};

But it doesn't work.

I have been searching for this for awhile but I haven't found the solution yet.


Solution

  • Change the port property in server/config.json. See https://github.com/strongloop/loopback-sandbox/blob/master/server/config.json#L4