Greetings,
I am new to Plesk, this is my initial posting.
I developed a website locally using my "localhost" and created all the site links, buttons, etc using a relative path structure. My server code is written in Node.js/Express. I am also using .ejs for a template engine...therefore all my server webpages are in a folder called "views/pages". My dedicated server is using Plesk Obsidian 18.0.36.
My Express routes are similar to this:
When I first navigate to the site URL the route for "/" is called, and the page ("_splash.ejs") is displayed...without any problems at all, it works perfectly as expected. It is on this page I have a button, which is coded as here:
A 'press' of this button SHOULD call the route called "/_landing" and proceed to render the page as directed in the code...however it does NOT. Instead it wants to load "https://mydomain.com/_landing". Upon doing so of course I get a "404 Page Not Found" error...which is understandable. What is not understandable is why the Express routing structure is suddenly ignored.
Why is this happening? Everything worked fine on my development ('localhost') machine, the problem only occurs now that I have uploaded to a Plesk server. For some reason the Node.js Express routes are now being ignored. I did find a posting on the Plesk Forum here "Resolved - use nodejs and problem with express routing" which seems very similar to my issue...however my modification of the "web.config" file (as indicated in the post) did not solve the issue.
Any help or suggestions would be GREATLY appreciated. This is extremely frustrating and I am currently at a loss on how to correct this issue. It is likely this is some issue with "web.config" or Nginx/Apache configuration? ...Especially since these file(s) are only associated with Plesk...and were non existant on my 'localhost' machine.
I thank you in advance.
Regards
I am new to Plesk, this is my initial posting.
I developed a website locally using my "localhost" and created all the site links, buttons, etc using a relative path structure. My server code is written in Node.js/Express. I am also using .ejs for a template engine...therefore all my server webpages are in a folder called "views/pages". My dedicated server is using Plesk Obsidian 18.0.36.
My Express routes are similar to this:
app.get('/', function (req, res) {
res.render('pages/_splash');
});
app.get('/_landing', function(req, res) {
res.render('pages/_landing', {user_stat: _subscriber});
});
When I first navigate to the site URL the route for "/" is called, and the page ("_splash.ejs") is displayed...without any problems at all, it works perfectly as expected. It is on this page I have a button, which is coded as here:
<a href="/_landing" class="btn btn-primary" role="button">Enter Site</a>
A 'press' of this button SHOULD call the route called "/_landing" and proceed to render the page as directed in the code...however it does NOT. Instead it wants to load "https://mydomain.com/_landing". Upon doing so of course I get a "404 Page Not Found" error...which is understandable. What is not understandable is why the Express routing structure is suddenly ignored.
Why is this happening? Everything worked fine on my development ('localhost') machine, the problem only occurs now that I have uploaded to a Plesk server. For some reason the Node.js Express routes are now being ignored. I did find a posting on the Plesk Forum here "Resolved - use nodejs and problem with express routing" which seems very similar to my issue...however my modification of the "web.config" file (as indicated in the post) did not solve the issue.
Any help or suggestions would be GREATLY appreciated. This is extremely frustrating and I am currently at a loss on how to correct this issue. It is likely this is some issue with "web.config" or Nginx/Apache configuration? ...Especially since these file(s) are only associated with Plesk...and were non existant on my 'localhost' machine.
I thank you in advance.
Regards