Question
How to run a simple node.js application in Plesk to test it working?
Answer
-
Go to Domains > example.com > File Manager.
-
Create a file
app.jsinhttpdocsdirectory and removeindex.htmlfile:
-
Click on the file
app.jsin File Manager to open it in built-in text editor and put the code below:const http = require('http');
http.createServer(function(request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end("Hello, World!n");
}).listen(process.env.PORT);console.log('App is running...');
-
Go to Domains > example.com > Node.js and make sure that Document Root and Application Root point to
httpdocsdirectory whereapp.jsfile stored -
Enable Node.js:

-
Open in a browser the
http://example.compage to see how is it working:Hello, World!