Adding a NodeJS application
To add a nodejs site in Cito, click the ‘Create Site’ button in the top right corner, and select the ‘NodeJS’ site type.
Setting up your application
Once you have created the site in Cito, you’ll need to:- Deploy your site’s files. This can be done using SSH, for example by cloning a Git repository or using SFTP to upload your content.
- Run
NPM installto install the application, including any dependencies. - Ensure your application has an
app.jsfile as its entrypoint.
Restarting a NodeJS application
Passenger has a couple of methods to do this:restart.txt
One method to restart an application is by touching the filerestart.txt in the application directory’s tmp subdirectory. Once Passenger has noticed that the file’s timestamp has changed, it will restart the application.
passenger-config restart-app
The preferred method for restarting an application, is through the passenger-config restart-app tool. This tool can run interactively or non-interactively. If you invoke passenger-config restart-app without arguments, it will ask you which application you want to restart.
Custom Entrypoints
If your Node application does not useapp.js as it’s entrypoint, you can change this by editing the passenger_startup_file directive in your site’s Nginx configuration.
This is found at /etc/nginx/conf.d/<username>.conf.
Note you will need to be logged in as admin and use the sudo command to edit this file.
