Hello I am trying to deploy my node app with postgreSQL ,but when I am trying to
“flyctl launch” it gaves me this error:
Failed creating the Postgres cluster facedetection-app-api-db: failed to launch VM: Post "http://[fdaa:0:e212;
Same error when I am trying to set up postgres by this command :
flyctl postgres create
Do I need some additional configuration to my server.js file? it looks like this for now:
const bcrypt = require('bcrypt-nodejs');
const cors = require('cors');
const knex = require('knex');
const register = require('./controllers/register');
const signin = require('./controllers/signin');
const profile = require('./controllers/profile');
const image = require('./controllers/image');
const db = knex({
// connect to your own database here:
client: 'pg',
connection: {
host: '127.0.0.1',
port: 5432,
user: 'rostorm',
password: 'test',
database: 'smart-brain',
},
});
const app = express();
const PORT = process.env.PORT || 8080;
app.use(cors());
app.use(express.json()); // latest version of exressJS now comes with Body-Parser!
app.get('/', (req, res) => {
res.send('Success');
});
app.post('/signin', signin.handleSignin(db, bcrypt));
app.post('/register', register.handleRegister(db, bcrypt));
app.get('/profile/:id', profile.handleProfileGet(db));
app.put('/image', image.handleImage(db));
app.post('/imageurl', (req, res) => {
image.handleApiCall(req, res);
});
app.listen(PORT, () => {
console.log(`Everything is working on ${PORT}, keep going!`);
});
any ideas how to fix this?