What it means
127.0.0.1 is the machine the app runs on, and 5432 is the usual Postgres port. On your laptop, a local Postgres may be running there. On the server, nothing is. The app was told to look for a database on its own machine.
How to fix it
-
Make sure your app has a database
Ask your agent: "Add a Postgres database to this project." Antideploy creates one beside your app and sets
DATABASE_URL. See how to add a Postgres database. -
Read
DATABASE_URLYour code must use the variable and not a fixed address.
-
Remove the localhost fallback
A line such as
process.env.DATABASE_URL || "postgres://localhost/mydb"quietly uses localhost when the variable is missing. Remove the fallback, so a missing variable fails loudly.
const pool = new pg.Pool({
connectionString: process.env.DATABASE_URL,
});
If you use your own database
If you use Supabase, your own Neon project or another Postgres, save its connection string as DATABASE_URL. A value you set yourself always wins, and Antideploy creates nothing.