Migrating Node.js apps from AWS EB to Heroku
Migrating Node.js apps from AWS EB to Heroku

Migrating Node.js apps from AWS EB to Heroku

181028

Danger

This post was written when I had little experience with Node.js. This is not an advisable way. This post simply serves as a departure post for my journey.

  • Node.js 앱을 AWS EB에서 Heroku로 옮기기

I have used AWS Elastic Beanstalk for a while and figured Heroku has several advantages over AWS. So I have migrated my AWS EB app called KMLA Forms to Heroku. For your information, KMLA Forms is a web app that simplifies writing necessary official documents in my school, KMLA.

Few advantages I found:

  1. Money. AWS costs money after its free tier limit. Since some of the students in my school used my web app, I have got some traffic, and AWS started to ask me about ~$10/month. As far as I know, there is no free tier traffic limit on Heroku.
  2. Native HTTPS support. Heroku natively supports HTTPS since every dyno app can use Heroku's domain. AWS EB, on the other hand, does not provide this. You need to configure your web domain and HTTPS Certificate for each web domain. Not valid for casual developers.

I had to make only minimal changes to app.js and package.json.

AWS Version

js
// ...
http.createServer(app).listen(8081, '0.0.0.0')
console.log('Server up and running at http://0.0.0.0:8081')

Heroku Version

js
// ...
const port = process.env.PORT || 8000
// ...
app.listen(port, () => {  console.log('App is running on port ' + port)})

Also, I have added "start": "node app.js" in package.json. Codes are on GitHub, and the web is launched here.

Backlinks (1)
  • 221119
Index
cho.sh
I prefer CLIBB9A08260619260619컴퓨트로늄37A88F컴퓨트로늄0CF03F컴퓨트로늄2C60FB260618260618260418260418260528260528AutoBuilder63849A260419260419Setup9AC296StellaD226F7260415260415Debian SetupD2F701260414260414anaclumos/configs/AGENTS.mdED86A3Ramp의 AX (회사를 AI로 물들이는 법)840774260413260413How to get your company AI pilled46544C260411260411260409260409260407260407260406260406Separating Claude Code Personal Sub and Claude Code Company Sub33A53C
Warning
This post is more than a year old. Information may be outdated.
// ...
http.createServer(app).listen(8081, '0.0.0.0')
console.log('Server up and running at http://0.0.0.0:8081')
// ...
const port = process.env.PORT || 8000
// ...
app.listen(port, () => {  console.log('App is running on port ' + port)})