I am trying to deploy my strapi backend version (4.0.2) application to heroku, i tried all solutions but nothing worked, i even followed the steps of deploying strapi to heroku from the docs with a NEW APP, and i got the same error, i manage to start the server and the application work but when i try to open the “/admin” url, it keep loading forever and show “error while requesting the api”.
in url “/” it show me “PRODUCTION” , the date, and “the server is running successfully”
and here what it show in the browser console.log after i open the “/admin” url it keeps loading forever, then after some minutes it shows this:
i need help, anyone please show me details how to deploy a strapi application version 4, i followed the docs step by step even with a newly created app and it didn’t work. i spent some weeks creating an app and i’m stuck in deploying the backend, help please?
here is code of some files:
./config/env/production/database.js
const parse = require('pg-connection-string').parse;
const config = parse(process.env.DATABASE_URL);
module.exports = ({ env }) => ({
connection: {
client: 'postgres',
connection: {
host: config.host,
port: config.port,
database: config.database,
user: config.user,
password: config.password,
ssl: {
rejectUnauthorized: false
},
},
debug: false,
},
});
./config/env/production/server.js
module.exports = ({ env }) => ({
url: env('MY_HEROKU_URL'),
})
./config/server.js
module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
});
./config/database.js
const path = require('path');
module.exports = ({ env }) => ({
connection: {
client: 'sqlite',
connection: {
filename: path.join(__dirname, '..', env('DATABASE_FILENAME', '.tmp/data.db')),
},
useNullAsDefault: true,
},
});
Please help.
System Information
- Strapi Version: 4.0.2
- Operating System: Windows
- Database: postgresql
- Node Version: 14
- NPM Version: 6
- Yarn Version: