将 Strapi API 部署到 Plesk [英] Deploy Strapi API to Plesk
问题描述
我在本地设置了 Strapi,效果很好.现在我想部署到 plesk,但我不知道如何部署.
I set up strapi locally and it works fine. Now I wanted to deploy to plesk, but I couldn't figure out how.
问题是,如果您运行 node.js 应用程序,plesk 要求以显式 (JS) 文件开始.这在另一个项目中很有效.但是在strapi中没有这样的文件.
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.
有什么想法吗?
推荐答案
Strapi 可以在没有 server.js 文件的情况下启动.
Strapi can start without a server.js file.
如果你需要一个 server.js 文件来运行 node server.js 而不是 npm run start
然后创建一个 ./server.js
文件如下:
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();
这篇关于将 Strapi API 部署到 Plesk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!