如何在端口80上运行回送应用程序 [英] How can I run loopback application on port 80

查看:53
本文介绍了如何在端口80上运行回送应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用基于expressjs的loopback.io,我试图将端口添加为app.listen的第一个参数,如下所示:

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'));
  });
};

但这是行不通的.

我已经搜索了一段时间,但尚未找到解决方案.

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

推荐答案

更改server/config.json中的port属性.参见 https://github.com/strongloop/loopback- sandbox/blob/master/server/config.json#L4

这篇关于如何在端口80上运行回送应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆