Node.js On Windows Server with Plesk

Why is your path /views ? It must be just /

With your current path the page will load when the url is:

https://yoursite.com/views

What confuses me is that the root of node.js should lead if I’m not mistaken to app / public and theoretically for what I understood the source file should be in app / index.js (judging the following prospect)
Schermata 2020-07-15 alle 15.47.46
Schermata 2020-07-15 alle 16.18.19

While the file retrieved by routing is located in: app/views/index.ejs

Index.js is used internally. Do not touch that file unless you know what you are doing.

Use routing for all your needs.

On the server, the file (page) created is physically in app / views
So how should the route be set to route correctly?
Schermata 2020-07-15 alle 17.00.58

/ => index

Marzio, are you sure you know how to use the routing panel? This has already been explained in the docs.

It couldn’t be simpler than that:

the file structure should be like this:

The route should point to the index.ejs file in the views folder (like @Teodor explained)

Edit: I changed the screenshot in case of misleading

Guys, you don’t use, edit or change the index.js file in the root folder! Especially if you don’t understand how NodeJS works :slight_smile:

1 Like

Teodor is exactly what I have been doing since the beginning
I can possibly make a mistake trying to change the path, which should be automatic with the choice of the file

The index.js file in the root is not present or at least it seems to me that I have not touched it

Content:
const server = require(’./lib/server’);
server.start();

Did you try it on the local Node Server?

I can’t understand what’s wrong.
It is definitely an incorrect path setting, I probably did something wrong in the configuration phase
However, the site is empty at the moment, so I eventually delete everything and start from scratch

Can you paste here the routes.json file you have in /app?


{
  "routes": [
    {
      "path": "/",
      "url": "",
      "routeType": "page",
      "page": "index",
      "layout": ""
    }
  ]
}

if I don’t find the solution, I cancel everything and start over

Looks OK to me. Have you cleared the cache in your browser?

I have tried clearing cache and history and with different browsers
Anyway I’m setting up node.js on another domain, to see if I have the same problem or not

Is this just a remote issue? Do you have the issue locally?

I have configured another domain, but unfortunately the error is always the same