Jump to content

[Solved] 404 after uploading a Node.js app


Mathieu

Recommended Posts

Hi. I've long dreamed of using Wasm server-side, so I was very excited when Node.js was announced for Tommy! Thank you. I'm still a little new to Node.js, though.

I downloaded Node.js version 10.16.3 to be compatible with Heliohost, wrote an app in JavaScript and Wasm, and got it working on localhost on my Windows 10 computer.

To finally upload it, I sort of followed the instructions at https://wiki.helionet.org/Node.js but I must have done this part all wrong because because it's been about 21 hours since I uploaded it, and I still see the 404 error when I try to visit the page.

Here are the things I'm concerned I may have done wrong, but I'm not sure which is the most important thing to change, if any:

  • My main JavaScript file is not called “app.js” as in the instructions, because I had called it something else when I first began the project.
  • I didn't enter “Node” in the “Name” field as the instructions said to, but rather used the name that I used when I first initialized the app with “npm init”.
  • I didn't enter “node” in the “Application URL” field as the instructions said to, but rather name of my app, because I'd like people to be able to use the <domain_name>/<app_name> to open the app.
  • I didn't enter “node” in the “Path” field, because I'd like to add another app to my site later, and I hadn't written my first app to be 2 apps from the beginning.
  • I uploaded all the files, including the “package.json” file, the “package-lock.json” file and the entire “node_modules” folder. Should I have rather just uploaded only the files I wrote and then used some npm tool in cPanel to install the dependencies?
    If I click “Ensure dependencies” in the Application Manager, it gives a green message saying, “Dependencies ensured...” and a ticked “Done”. Again, is this something I should have clicked before/instead of uploading all the package files?

About 2 hours ago, I uploaded an empty tmp/restart.txt file, but still the 404 error.

Which of the above things should I change, and which of them are fine? Is there anything else I may have done wrong?

Link to comment
Share on other sites

My main JavaScript file is not called “app.js” as in the instructions, because I had called it something else when I first began the project.

It has to be named app.js. If you don't want to name it app.js you can instead make a symlink. So, for instance, if you want to call it index.js you would need to make a symlink named app.js that points to index.js.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...