Deploy Angular & Node to Elastic Beanstalk
The default port for EB is 8080. Node will be started at port 8080.
It’s important to point Angular to port 8080. In environment.prod.ts
, adds
1 | export const environment = { |
then in terminalng build --prod
. The enviroment.ts
will be replaced by environment.prod.ts
.
It’s also important to start Node at port 8080. The process.env.PORT is not set by a new Elastic Beanstalk instance. Thus at the end of index.js
or server.js
of Node, include
1 | const port = process.env.PORT || 8080; |
赞赏一下