I have not been able to connect to my database using Sequelize because it gives me the following error: Unable to connect to the database: HostNotFoundError [SequelizeHostNotFoundError]: getaddrinfo ENOTFOUND
PD: I am new to Fly.io
Connection code
const { Sequelize } = require("sequelize");
const databaseUrl = process.env.DATABASE_URL;
// Check if the environment variable is set
if (!databaseUrl) {
console.error("The environment variable is not defined.");
process.exit(1); // Terminates the process with an error code
}
// Configure Sequelize with direct URL
exports.sequelize = new Sequelize(databaseUrl, {
dialect: "postgres",
dialectOptions: {
ssl: {
require: true,
rejectUnauthorized: false,
},
},
});
Any kind of help will help me, thank you.