Deploying angular app to AWS Elastic beanstalk

前端 未结 3 777
悲&欢浪女
悲&欢浪女 2021-02-06 03:00

I’m trying to deploy a very basic angular app to elastic beanstalk. The project was created using the angular cli. I have not made any changes to the files in this project.

3条回答
  •  故里飘歌
    2021-02-06 03:29

    Got the deployment issue resolved! I used express to create a server and serve my angular app. I needed to add server.js to my dist/ folder. My server.js file looked like so

    const express = require('express');
    const http = require('http');
    
    const app = express();
    
    const port = process.env.PORT || 3001;
    
    app.use(express.static(__dirname));
    
    const server = http.createServer(app);
    
    server.listen(port, ()=> console.log("Running..."));
    

提交回复
热议问题