amazon-web-services - 将Ember.js应用程序部署到AWS Elastic Beanstalk

标签 amazon-web-services elasticsearch ember.js amazon-elastic-beanstalk

我已经尝试并搜索了如何在AWS Elastic Beanstalk上部署emberjs应用程序,但是找不到方法。
我正在使用EB CLI进行部署和配置。
如果有人有将ember应用程序部署到Elastic Beanstalk的经验,请分享。

最佳答案

不建议这样做
正如@jelhan在线程注释部分中提到的,我们应该使用S3和CloudFront托管静态文件。
我们还可以使用AWS放大https://aws.amazon.com/amplify/console/
我已经完成了这部分的测试目的。
为此,我按照以下步骤进行了一些操作

  • 将.ember-cli.js文件中的dist路径更新/添加到“dist / www”
    “outputPath”:“dist / www”
  • 添加server.js和package.json文件
    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"
       }
     }
    
  • 更新server.js文件以托管静态文件
    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);
  • 通过eb init初始化 flex beantalk设置
  • 通过运行eb deploy命令将应用程序部署到 flex beantalk
  • 关于amazon-web-services - 将Ember.js应用程序部署到AWS Elastic Beanstalk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64587548/

    相关文章:

    json - AWS API 网关模型 : Invalid model schema specified

    amazon-web-services - 无服务器(或精简服务器)注入(inject)来自 Axis IP 网络摄像头的定期图像上传

    python - PyPDF2 问题和从 S3 解码 pdf 文件

    elasticsearch - 如何从elasticsearch的默认_英语_停用词列表中删除停用词?

    unit-testing - 模拟Elasticsearch聚合

    php - AWS EC2 - Amazon Linux AMI - PHP 脚本不起作用(Slim 框架)

    ruby-on-rails - 如何使用 RSpec 测试 Elasticsearch 和 Searchkick

    javascript - 向 Ember 应用程序添加一个 "times" block 助手

    ember.js - 如何防止 View 在 Ember.js 中被破坏

    ember.js - Ember-Data 中的部分更新?