Strapi 4 server file for production
Place server.js at the root level of the Strapi project. I opted for a .js file instead of .ts to keep it simple, as I couldn't get the TypeScript version to work:
/home/deploy/strapi-backend/server.js
const strapi = require("@strapi/strapi");
const app = strapi({ distDir: "./dist" });
app.start();
You can put your file at root level of your project:
Last updated on