javascriptnode.jsweb-hostingpublic-html

Which server directory to place webapp files for a node js application


So I feel like this is a simple question that has just been evading me so hopefully I can get some help here. I have developed a nodejs webapp, the directory structure can be seen in the screenshot below. Eventually, this app will implement a mongodb and house a hefty size of audio files.

I am using the inMotion Premier Support hosting plan (pretty basic) and when taking a look at the server through fileZilla I see there is a public_html directory.

Do I put the whole contents of my webapp (everything in the screenshot) in the public_html directory? I assumed that only the files that should be publicly accessible should go in there (only the contents of my apps public directory). If that's the case where would I place the files that would be considered server-side (everything on the same level as app.js).

Also my hosting service isn't dedicated or even virtual so I don't have access to the whole server just a certain number of directories.

Any help is appreciated

I am currently working on a webapp. enter image description here


Solution

  • What you want is a VPS on inMotion, not a FTP server. The public_html directory in these web hosting services is where you usually put static html files. If you want to deploy node.js web apps, look at getting a server through VPS.