我在自己的机器上运行localhost上的Express API服务器。 如何从Internet而不仅仅是我自己的机器访问它?
优选地,它将部署在AWS上。
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.
最满意答案
在AWS中,有多种方式可以基于灵活性和便利性来托管您的快速应用程序。
AWS Elastic Beanstalk:通过在AWS Web控制台中的一个位置创建具有版本管理和回滚支持的自动扩展和负载平衡环境,这将为您提供更多便利。 还为您提供IDE支持,以支持CI / CD支持的部署和CLI命令。
AWS ECS:如果您计划将应用程序停靠(我强烈推荐),您可以使用AWS ECS管理具有容器级别的自动扩展和负载平衡支持的docker群集,以获得更多便利。 这也为CI / CD提供CLI。
AWS EC2:如果您需要更高的灵活性,您可以在AWS中获得虚拟服务器,并手动配置自动扩展和负载平衡,我更喜欢将其作为Web应用程序的最少选项,因为您必须手动执行大部分操作。
如果您正确配置它们以从外部授予访问权限,则所有这些服务都将为您提供可公开访问的URL。 您需要正确配置网络和安全组,或者将负载均衡器或实例IP / DNS URL暴露给外部。
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.
更多推荐
发布评论