1

I set up strapi locally and it works fine. Now I wanted to deploy to plesk, but I couldn't figure out how.

The Problem is, plesk asks for an explicit (JS) file to start with, if you run a node.js application. This works well in another project. But there is no such file in strapi.

Any ideas?

1 Answers1

5

Strapi can start without a server.js file.

If you need a server.js file to be able to run node server.js instead of npm run start then create a ./server.js file as follows:

const strapi = require('strapi');

strapi(/* {...} */).start();
Jim LAURIE
  • 3,859
  • 1
  • 11
  • 14
  • 1
    I've managed to deploy to my plesk installation with your answer, but certain sections like the "Content Type Builder, or the "Configurations") are not available, returning the notification "Reload feature is required for this plugin.". Says I need to run strapi with one of the following commands: "strapi develop" or "npm run develop". I'm assuming I should be able to pass an option into the strapi() function, but I cannot find out what it should be. Any clues? – Urb Gim Tam Sep 27 '19 at 15:39
  • 2
    You deployment on Plesk is for your production environment, right? We bloc these features because we do not recommend to update your application configuration and your content types in production. – Jim LAURIE Sep 30 '19 at 09:06
  • I do have the same problem. Plesk's node config allows you to call a file. @JimLAURIE suppose i want to use the same server for admin and prod, how can i invoke the admin version using the above file ? – Deepan Prabhu Babu Jun 19 '20 at 08:08
  • simply change plesks node mode to developement. – smonkey Nov 24 '20 at 12:15