I have a server on debian 9 with Plesk installed. Node JS extension is also installed, but when i try to make an NPM start, i get stuck with this message :
As stated on the documentation, it is not the right way to deploy your app on a remote server
From the previous message, I guess you already have a development installation working. In order to deploy your code to a remote server, You just need to go to your project settings, under the environment tabs. Then you should be able to deploy from here, by just updating your environment variables.
(You can find some doc on how to deploy on a ubuntu server here)
Well, sadly, i didn’t get any error… When i started the server (with npm start) the console returned that everything was ok, but when accessing the domain name or the app.forestadmin, it said that my server was unreachable
This is the default deployment process (It’s very easy to do), and it should work for both debian & ubuntu (Since you are just deploying a nodejs process, and eventually hosting a database).
As stated @Steve_Bunlon, maybe you had an error in chrome console/network tabs to share (The process you mentioned should work, even if that’s not the encouraged way to deploy).
Just let us know if you re-encounter the issue using the deploy process you choose initially, or the “classic” way to deploy
Oooookay so, i’ve tried the git solution to deploy on my plesk server. Here is the result that my domain name show when i’m on his web page with node js launched :
/var/www/vhosts/vivactishealthcare.com/admin.vivactishealthcare.com/node_modules/express-jwt/lib/index.js:20
if (!options || !options.secret) throw new Error(‘secret should be set’);
^
Error: secret should be set
at module.exports (/var/www/vhosts/vivactishealthcare.com/admin.vivactishealthcare.com/node_modules/express-jwt/lib/index.js:20:42)
at Object. (/var/www/vhosts/vivactishealthcare.com/admin.vivactishealthcare.com/app.js:36:9)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at Module.require (/usr/share/passenger/helper-scripts/node-loader.js:80:25)
at require (internal/modules/cjs/helpers.js:16:16)
at loadApplication (/usr/share/passenger/helper-scripts/node-loader.js:243:2)
at setupEnvironment (/usr/share/passenger/helper-scripts/node-loader.js:214:2)
at Object. (/usr/share/passenger/helper-scripts/node-loader.js:133:1)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:837:10)
at internal/main/run_main_module.js:17:11
Also, i have this error on the env configuration page (when FA send the new secret key etc) :
Access to XMLHttpRequest at ‘https://admin.vivactishealthcare.com/forest’ from origin ‘https://app.forestadmin.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
I’ve added the environment variables as a custom variable for node right in plesk, but it still doesn’t work…
If i try to access my domain name, it return me that the panel is available on https://app.forestadmin.com/projects but there is nothing except my local dev environment
Okay, i’ve followed your link and this end up with a new error :
Access to XMLHttpRequest at ‘https://admin.vivactishealthcare.com/forest/sessions’ from origin ‘https://app.forestadmin.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: The value of the ‘Access-Control-Allow-Credentials’ header in the response is ‘’ which must be ‘true’ when the request’s credentials mode is ‘include’. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
I’d say rollback the latest changes then, I’m not really familiar with Plesk, are you sure you set the right CORS_ORIGIN ? Did you edit anything in your project ?
I think the problem comes from your Plesk configuration then, setting up the CORS_ORIGIN variable should be enough for FA to work. Maybe look into your nginx conf if you use one as a reverse proxy.