Node.js On Windows Server with Plesk

Windows server is really a very bad choice to run NodeJS on. It will give you a lot of installation troubles as you already noticed. And it is a costly overkill.

Do you really need a Windows Server?

George
Unfortunately the domains that at this moment I would like to use with nodeJS are on Aruba Business shared Hosting in Italy and I have the possibility to choose Windows Server (Plesk Obsidian) or Plesk Linux Server
But apparently with Linux there is no nodeJS
I should change Server Hosting, but it is currently a problem

However, I would like to know, if possible, which servers can be optimal for NodeJS with Wappler

George
nothing to do with hosting; nodeJS available only with Windows server, with Linux it is not disponible.
Therefore I think I will not be the only one who wants to use JS node with Windows server. Then if the setting option for Windows Server cannot be insert in Wappler, , a step-by-step tutorial would be appreciated for how to install nodeJS on Windows server and how to conveniently modify it in Wappler and on the server.
maybe someone in the community already has the correct solution for this?

After many attempts (on three domains), I found the Wappler / Server Windows connection with NodeJS
With this procedure I can now view the Index.ejs file online; even if I have two problems that I can’t solve for the moment:
1 Step - Project creation and download all services


2 Step - Install packages
In Developer mode install Node Packages
And also in Local mode install Node Packages
3- Step Remote server ftp connection created and publish project
4- Step Edited index.ejs file and saved

5- Step Server and Node.js configuration
node.js without public directory in root document
Install npm and restart app
node9
6- Step Give permissions to the tmp folder

Now is OK
if in the browser I type url of the site xxxxxxxxxx.xx
the index.ejs page appears
so the connection is correct and the file has been saved correctly

Good, but now there are two problems that I can’t solve:

1 PROBLEM -
If I edit in Wappler the index.ejs page and save it, the file is correct in the VIEWS directory of the server, but in the browser the page is not updated (even by clearing cache and history)
To get the page update I have to (in the node.js configuration panel) choose again
the root document /mg, and magically the page updates

2 PROBLEM -
With this setting the page is displayed but does not read assets / bootstrap / css / dmxAppConnect which are in the public folder
I could theoretically modify each file by adding public / to each link, but it is clearly very inconvenient and impractical
Or I could move the folders in public folder to the main folder, but then I would have problems with Wappler

I think however that if these two problems are solved the rest should work well
I look forward to your suggestions

I see you have selected docker hosting? You should use regular ftp for Plesk and not docker

Ok George
I try again on a domain without Docker and see what happens
Thank you

Hi George
I repeated the creation of the project without Docker, but the two problems remain.
In practice node.js works only if the document root is the same as the application root, but unfortunately then it search in the main root and does not find the folders that are present in public folder
For the moment I have no valid idea to remedy this problem.
For the problem instead of not updating, I can’t understand why, since the updated file is present in the views folder

Addendum
If in the index.ejs file code I modify the links with the addition “public /” when I save the file Wappler eliminates the links changes

I understand that this problem does not interest anyone, except me. However, I continue to try to find the solution.
Meanwhile, the first problem maybe I solved:
I completely deleted the public folder, both in the Wappler project and on the server, after transferring all the contents to the root directory.
I have yet to carry out extensive tests, especially for dynamic pages, but at the moment it seems to be working very well
If this is the correct solution, perhaps Wappler could foresee when setting node.js the possibility of not using the public folder and use the main root (in case of use on Windows server)

The problem that remains unsolved is the fact that every time a page is changed, by clicking on save, the files are correctly saved in the server, but the page view is not updated at the same time, even if sometimes it is updated after a few tens of minutes.
I noticed that in the tmp folder the restart.txt file is not always present and when there is nothing in it.
Is this setting in the package.json file correct?
Schermata 2020-07-31 alle 23.53.46

For each update the NodeJS server have to be restarted. This is done automatically by uploading a special file called tmp/restart.txt

Maybe your server don’t have this enabled. Check the NodeJS options on Plesk and the setup guide we have provided. Try restarting node there - there is a special button for this in the Plesk NodeJS options

Hi George
I join the screenshot of the node.js settings


but I can’t find the special button.

It seems to me that Wappler correctly saves the files when clicking on “save”, but does not create any restart.txt file in the “tmp” folder

Other than that, if in the server I click on restart node.js, it gives me a first time, perhaps because it doesn’t find any restart.txt files

but whwn click a second time is ok

But it still doesn’t seem to work properly.

If it can be used to find out the cause, this is an error that is reported when installing NPM
Schermata 2020-08-03 alle 10.52.00

Those are just warnings and you can ignore them

well but I don’t understand why it works all the files are updated but the old page is always displayed in the browser, even if I click on restart from the nodejs panel

well make sure all new files are uploaded, or just click on publish when your live target is selected for full ftp synchronization.

I don’t know what you mean by full FTP
However, it is the first thing I checked
even changing only the text of the index.ejs file, after saving to the server the file has the new text but the page in the browser does not update.
Or at least it updates only occasionally
Could it be a network problem? Why am I currently using a Vodafone ADSL connection in a location at 2000 meters?

It is strange Almost always to be able to update the display of the site you have to click and choose the main address again
Schermata 2020-08-03 alle 17.08.49

Marzio,

Please follow exactly the NodeJS setup tutorial for Plesk