- 최신
- 최다 투표
- 가장 많은 댓글
When deploying an Express.js application manually to AWS Amplify Hosting, there are several considerations to ensure successful deployment.
Based on your description, it appears you're trying to manually deploy a pre-built Express.js application as a zip file, but encountering a 404 error after deployment. Here are some potential issues and solutions:
-
Deployment Structure: Amplify Hosting expects specific file structures depending on the framework you're using. For Express.js applications, Amplify needs to properly identify your entry point (server.js in your case).
-
Start Command: Ensure your package.json includes a proper "start" script that points to your server.js file. For example:
"scripts": { "start": "node server.js" }
- Server Configuration: Make sure your Express.js server is configured to listen on the port provided by Amplify's environment. Typically, you would use:
const port = process.env.PORT || 3000; app.listen(port);
-
Build Output: Verify that all necessary files (node_modules, package.json, server.js) are included in your zip file.
-
Amplify Configuration: Your deploy-manifest.json looks correct with the entrypoint set to server.js, but ensure it's properly placed in the .amplify-hosting directory.
Unfortunately, Amplify Hosting doesn't provide extensive logs for manual deployments. To troubleshoot further, you might consider:
- Simplifying your application to a basic Express.js server that returns a simple response
- Verifying your zip file structure matches what Amplify expects
- Checking if your Express.js application works locally before deployment
- Trying the GitHub-based deployment once more with the same code to compare results
If the issue persists, you might need to reach out to AWS Support for more specific assistance with your Amplify configuration and Express.js deployment.
Sources
Deploy React and Server Side Rendered Apps and Static Sites - Amplify Hosting - AWS
my amplify deploy app problem | AWS re:Post
Instance deployment failed to generate a 'Procfile' for Node.js. Provide one of these files: 'package.json', 'server.js', or 'app.js'. The deployment failed. | AWS re:Post
Hi,
Express.js must run on a server. Amplify Hosting does not support manual deploys for server-side rendered (SSR) apps [1]. For guidance on deploying an Express server, please refer to this documentation [2].
Thank you!
[1] https://docs.aws.amazon.com/amplify/latest/userguide/manual-deploys.html
[2] https://docs.aws.amazon.com/amplify/latest/userguide/deploy-express-server.html
