thiagoenca Posted November 9, 2022 Posted November 9, 2022 Hello Heliohost managers! I need some help, yesterday I made a upload of my Node.js application: Name: Node.js APP Installation path: http://marcatexto.helioho.st My APP has these configs: My FTPS inside /httpdocs already has the code (I tried before create a new folder named Node following a tutorial that I found but didn't work too): I already ran the npm install (button) and restart app (button). But what is happening is so weird, because when I try to test my route (http://marcatexto.helioho.st/login) it's showing a error handling message that I created when someone try to access other routes without a token that I created as below. The thing is, this route doesn't need this token to work, because this route generate the token that I will use in other routes: You could think that is an issue with my app, right? But when I try to run locally, with HelioHost database is working perfectly: So, I'm pretty lost about how to proceed. The screenshot below shows my app.js file: Can someone give me some help, please?
Unknown025 Posted November 9, 2022 Posted November 9, 2022 It's a bit hard to tell what your issue is without seeing what your routing for the authentication looks like, but you could check the logs for any errors regarding connecting to the database or rejecting requests with a 401.
thiagoenca Posted November 9, 2022 Author Posted November 9, 2022 31 minutes ago, Unknown025 said: It's a bit hard to tell what your issue is without seeing what your routing for the authentication looks like, but you could check the logs for any errors regarding connecting to the database or rejecting requests with a 401. Hey, I looked the logs but it's not bringing so clear information: Would help if you have access to the code? But for me doesn't make sense work in local and not in heliohost server (it seems that it is lost)
thiagoenca Posted November 9, 2022 Author Posted November 9, 2022 Hey @Unknown025 can you escalated this situation please? We really need help here
thiagoenca Posted November 9, 2022 Author Posted November 9, 2022 Hey @Krydoscan you help us here, please?
thiagoenca Posted November 9, 2022 Author Posted November 9, 2022 I noticed some differences from this tutorial (https://wiki.helionet.org/tutorials/node.js😞 1. The cpanel is different now, and we can't register an application. Now our app is already there. So I couldn't change the path to node as mentioned in the tutorial nether application url. Now, what we have is this: If I try to change document root to "node" folder it doesn't allow me to do this.
Krydos Posted November 9, 2022 Posted November 9, 2022 6 minutes ago, thiagoenca said: So I couldn't change the path to node as mentioned in the tutorial nether application url. On Plesk you can't run node apps in a subdirectory. They have to be at the webroot. 4 hours ago, thiagoenca said: But when I try to run locally, with HelioHost database is working perfectly: Are you using Passenger locally too?
thiagoenca Posted November 9, 2022 Author Posted November 9, 2022 10 minutes ago, Krydos said: On Plesk you can't run node apps in a subdirectory. They have to be at the webroot. Are you using Passenger locally too? @KrydosThe structure that I've now is this: My code is inside "node" folder and "httpdocs". Both are sending me the same message mentioned above. Sorry, I don't know what is Passenger. But to make work in my codebase locally, I just placed the database info into my .env file: What changes I should do to make work?
Krydos Posted November 9, 2022 Posted November 9, 2022 I would simplify things a bit. Your pages are returning error code 401 which means authorization required. They should be returning 200 ok. Maybe try setting up a test app that doesn't have database connection, and all the other complications. Then if that works you can build from that and make small changes. If you get an error after a change you can know what the issue is. The way things are now it could be 500 different things causing the issue, and it's difficult to narrow it down. The other thing that might be useful is installing Passenger locally so you have a more similar development environment in case that is what is causing issues.
thiagoenca Posted November 9, 2022 Author Posted November 9, 2022 3 minutes ago, Krydos said: I would simplify things a bit. Your pages are returning error code 401 which means authorization required. They should be returning 200 ok. Maybe try setting up a test app that doesn't have database connection, and all the other complications. Then if that works you can build from that and make small changes. If you get an error after a change you can know what the issue is. I don't think this would be the best approach for me now, since I have a lot of code and locally it's working with heliohost db. It's seems some configuration error. When you say that the code should be in webroot, you mean that should below to `Home directory` but at same level that .npm, .git, ... this?
Krydos Posted November 9, 2022 Posted November 9, 2022 1 hour ago, thiagoenca said: When you say that the code should be in webroot, you mean that should below to `Home directory` but at same level that .npm, .git, ... this? Webroot means marcatexto.helioho.st. Subdirectory would be something like marcatexto.helioho.st/node. You can also use the webroot of a subdomain like node.marcatexto.helioho.st. 1 hour ago, thiagoenca said: I don't think this would be the best approach for me now, since I have a lot of code and locally it's working with heliohost db. It's seems some configuration error. Up to you. I've been developing software for quite a few years and it's always easier to start simple and debug one problem at a time than start at maximum complexity and debug 100 issues at the same time. 1 hour ago, thiagoenca said: I have a lot of code and locally it's working This doesn't really mean anything if your development environment is different than your production environment. It's like saying my boat works fine when it's on my development lake, but it doesn't work at all on my production parking lot. The environment of a lake and a parking lot are quite different.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now