有没有人成功停靠Loopback-4(lb4)应用程序?我设置了一个基于lb4的应用程序,并试图将它停靠,但是虽然Docker似乎正在运行应用程序,但它并没有在我的localhost上显示.
我做的步骤:
但是,应用程序不会显示在http:// localhost:3000上 运行容器的输出:
trip@1.0.0 prestart/usr/src/app npm run build
trip@1.0.0 build/usr/src/app lb-tsc es2017 --outDir dist
trip@1.0.0 start/usr/src/app node.
编辑
为了保存这个问题,回购中的相关代码(步骤2)被粘贴在这里,
// index.js
const application = require('./dist');
module.exports = application;
if (require.main === module) {
// Run the application
const config = {
rest: {
port: +process.env.PORT || 3000,
host: process.env.HOST || 'localhost',
openApiSpec: {
// useful when used with OASGraph …Run Code Online (Sandbox Code Playgroud)