- Le plus récent
- Le plus de votes
- La plupart des commentaires
Please refer to the documentation.
You are trying to go to an address that contains an IP of
127.0.0.1
,localhost
, or0.0.0.0
. The default, built-in behavior of the AWS Cloud9 IDE is that this will attempt to go to your local computer instead of attempting to go the instance or your own server that is connected to the environment.
So in your case, the HTML file you open in the Cloud9 IDE tries to connect to localhost
which is then translated to your local machine, not the EC2 instance your Cloud9 environment (and your NodeJS server) runs on.
Instead, consider changing the target host in your HTML file.
- Start your NodeJS server in the terminal as described in your tutorial
- In Cloud9, go to Tools --> Preview --> Preview Running Application
- A new IDE tab will open, where you can see the output like "Welcome to your server"
- In that new preview tab, click on the address bar and copy the URL you'll find there, it will be something like
https://12a34567b8cd9012345ef67abcd890e1.vfs.cloud9.us-west-1.amazonaws.com
(with a different ID and probably a different region) - Replace
localhost
in the HTML file with the host name from above - Save your HTML file and try to test your app again
Alternatively, just make the action in your HTML form to a relative URL:
<form action="/login" method="POST">
Cloud9 will automatically forward the requests to your running application on ports 8080, 8081, or 8082. See the documentation for details.
Contenus pertinents
- demandé il y a un an
- demandé il y a un mois
- demandé il y a 6 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a un an