Node.js On Windows Server with Plesk

If it is any consolation, I get the same warnings without detrimental effects.

Thanks for the comfort
I have repeated this node.js procedure several times on different domains, but I always end up with this problem
By the way I also have a problem with database management.
The development db is ok, while the remote db doesn’t work; I have reported the error but I have not had a response
However, now I focus on the first problem
I hope to solve soon because I have urgent work and I would like to carry out with node.js

Ben
I have a doubt. Is your site where node.js works in HTTP or HTTPS mode?

HTTPS

well all the domains I have them in https
thank you

Hello, in my node.js project I am missing package.json, should it be added when the project is created?
image

If it type in my domain without /index.html it is working showing no 404 message.

package.json is required for your development environment.

It is also important to upload it to the remote server so that when you install NodeJS, NodeJS knows which modules to include.

1 Like

Thank you, is there some way for me to have it recreated or do I need to add manually?

Have a look at what @George replied in another topic:

1 Like

Sorry Ben if I stress you
I am waiting for a response from Hosting assistance to try to solve this obstacle
I would like to know if in your working nodeJS configuration the public folder contains a filexxxxx.js
My public folder is this
Schermata 2020-07-17 alle 18.51.43

This is my file structure:

1 Like

Thanks Ben
I have deleted the httpdocs directory and in the public directory I have not JS or JSON files
But I don’t know they are structured and if necessary to solve my problem
And I don’t understand why Wappler does not made them automatically

I’m still waiting for a complete response from Hosting assistance and I don’t even have solutions from Wappler, but I wonder: how can it work if there is not files js in the Public directory?

When the site loads, it executes a file named index.js. This is the default document for NodeJS as index.html is for an HTML server or index.php for a PHP server.

index.js requires server.js which sets all of the parameters for the server and starts the server

When the server runs, it will rely on the routing (URL params) to load the required page. When there are no URL params, it will load the page that has been set as the default. In this case it is index.ejs, but this could be home.ejs or any other .ejs combination.

That is briefly it.

If you have a few hours to spare, this video series is a good place to start learning, keeping in mind that Wappler performs most of the functions.

3 Likes

The Hosting Assistance replied to check the permissions of the public directory (as I had already done), but also informed me that the server works perfectly and that the inconvenience is to be found in the application code
I’m pretty demoralized and I’m starting to think about abandoning the idea of using node.js.
However a possible error, I think it is in the starting file index.js, as shown by this screenshot

Ben
Well the settings of your screenshoot are identical to mine, with the exception of line 28 of the server.js file, but I don’t think that’s the problem
Schermata 2020-07-21 alle 00.14.24

You are right, this should not be the problem.

The difference is the method of obtaining the views. I do not know enough about NodeJS or about the way that Wappler has organised the process. Only thing that I can add to this is that I thought that NodeJS handled the requests asynchronously by default.

I just noticed that your remote host is based on a Windows server rather than Apache or Nginx. I have no experience using Windows, but the following should help you.

https://tomasz.janczuk.org/2011/11/debug-nodejs-applications-on-windows.html

Thanks Ben, maybe you have found the cause that is preventing the operation
Before intervening with the instructions you have attached, analyzing the Plesk panel I noticed that there is the possibility of modifying IIS
I don’t know this very well, but maybe it’s here I have to intervene?