Justin Borromeo
Justin Borromeo

Reputation: 1361

How do you make an Express.js API accessible from the Internet?

I have an Express API server running on localhost on my own machine. How do I make it accessible from the Internet and not just my own machine?

Preferably, it would be deployed on AWS.

Upvotes: 0

Views: 156

Answers (1)

Ashan
Ashan

Reputation: 19738

In AWS there are multiple ways of hosting your express application based on flexibility vs convenience.

  • AWS Elastic Beanstalk: This will provide you more convenience by creating an autoscaling and loadbalancing environment with version management and roll back support from one place in AWS web console. Also provide you IDE support for deployments and CLI commands for CI/CD support.

  • AWS ECS: If you plans to dockerize your application(Which I highly recommend) you can use AWS ECS to manage your docker cluster with container level Autoscaling and loadbalancing support for more convenience. This also provides CLI for CI/CD.

  • AWS EC2: If you need more flexibility, you can get a virtual server in AWS and also manually configure autoscaling and loadbalancing which I prefer as the least option simply for a web app since you have to do most of the things manually.

All this services will provide you with publicly accessible URL if you configure them properly to grant access from outside. You need to configure networking and security groups properly either exposing the loadbalancer or instance IP/DNS URL to the outside.

Upvotes: 1

Related Questions