If your server is running an older version of Node and you would like to upgrade to the current default, please contact support.
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.
Fill in the domain name you wish to use, followed by an SSH user.
Once the site has been created you’ll be presented with its details, including a preview URL.
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
Deploying your code doesn’t restart your application, whether you use ‘Deploy latest’ in the dashboard, SSH or SFTP. Restart it after each deploy so Passenger loads the new version. See Working with Git.
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.
