我已经尝试并搜索了如何在AWS Elastic Beanstalk上部署emberjs应用程序,但是找不到方法。
我正在使用EB CLI进行部署和配置。
如果有人有将ember应用程序部署到Elastic Beanstalk的经验,请分享。
最佳答案
不建议这样做
正如@jelhan在线程注释部分中提到的,我们应该使用S3和CloudFront托管静态文件。
我们还可以使用AWS放大https://aws.amazon.com/amplify/console/
我已经完成了这部分的测试目的。
为此,我按照以下步骤进行了一些操作
“outputPath”:“dist / www”
package.json
{
"name": "ember_frontend_server",
"version": "1.0.0",
"description": "We are using node server to serve static files",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"author": "",
"license": "MIT",
"dependencies": {
"express": "^4.17.1",
"path": "^0.12.7"
}
}
var express = require('express');
var path = require('path')
var app = express();
var port = process.env.PORT || process.argv [2] || 8081;
app.use(express.static(path.normalize(__ dirname +'/ www')))
app.use('*',(req,res)=>
{
res.sendFile(__ dirname +'/ www / index.html');
});
app.listen(port);
关于amazon-web-services - 将Ember.js应用程序部署到AWS Elastic Beanstalk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64587548/