Node.Js
SandBox NodeJs app deployment and NPM management.
Deploy SandBox NodeJs Apps
How to deploy NodeJS Apps on Eenos?
This document will help you to deploy a NodeJs app on your eenos hosting control panel. Eenos control panel is a modern hosting control panel designed for modern apps.
Features Of Eenos NodeJs App Management
Eenos control panel has the following wonderful features for easy management of nodeJs apps.
- Manage unlimited NodeJs app domains or subdomains
- NodeJs version Selector
- Deploy NodeJs App with One click
- Set to Production or Development Mode
Every eenos NodeJs app has its own virtual environment. So migration and transfer of hosting accounts are very easy.
To start deploying the NodeJS app, login to your eenos control panel and go to the following Page:
Node.Js -> Deploy Node.Js Apps
Setup NodeJs SandBox and Install Apps
Now you need to fill out the simple form as follows,
Choose Domain For Node.Js App: Select a domain or subdomain for deploying a NodeJs app. This is the website url you are going to deploy the app.
Choose Node.Js Version: The version of the Node.Js distribution required for your project.
Now, you need to set the App settings also, so that the server knows where to start the applications.
App Startup Script: This is the app entry point script. It is normally a javascript file in the project document root ( eg: app.js )
Public Folder Name: This is where you upload your static files like CSS, JS, Images, etc.
Project Publicity Type: This option will help you to set up the project in either production or development mode.
Install Demo App: If you wish to install a demo nodejs app, choose install. If you already developed the app, you can select no and upload the files yourself.
Now, Click the button Deploy App and it will start deploying the app.
Manage NodeJs App From Shell
If your hosting account has enabled SSH access, you can easily manage your NodeJS app from the shell too. You may contact your hosting server provider and enable the ssh shell to access this feature.
You may login to the server with the ssh client from your desktop.
Here, we are going to use the following details to show you how to manage the NodeJS app from the eenos sever shell virtual environment.
Example eenso user: myuser
Example NodeJs app domain: nodejs.mydomain.com
Example eenos ssh server port: 22
The document Root of the App is : ~/nodejs
Login to the SSH terminal
Login to the SSH server with the following command,
ssh myuser@nodejs.mydomain.com -p 22
Activate NodeJs Virtual Environment
Activate the Virtual Sandbox NodeJS environment for the domain nodejs.mydomain.com as follows,
myuser:$ ~ $ source ~/.sandbox/nodejs/nodejs.mydomain.com/bin/activate
(nodejs.mydomain.com) myuser:$ ~ $
Done, you are on the domain's NodeJs environment, and you can start working on your NodeJS app from the terminal.
See some example commands below,
Go to the app document root, list NPMs, and check the nodejs version.
(nodejs.mydomain.com) myuser@:$ ~ $ cd nodejs/
(nodejs.mydomain.com) myuser:$ ~/nodejs $ npm list
nodejs@ /home/myuser/nodejs
├── async@3.2.3
├── express@4.17.3
├── list@2.0.19
├── lodash@4.17.21
├── rxjs@7.5.5
└── yes@1.1.1
(nodejs.mydomain.com) myuser:$ ~/nodejs $node -v
v16.13.0
Deactivate NdoeJs Virtual Environment
You can deactivate the current working NodeJs shell virtual environment using the following command,
(ndoejs.mydomain.com) myuser@:$ ~ $ deactivate
myuser@:$ ~ $
Switch NodeJs SandBox Virtual Environment
If we have another NodeJs app on the domain chat.mydomain.com on the same eenos hosting account, we can switch to the virtual environment for the chat app as follows,
myuser:$ ~ $ source ~/.sandbox/nodejs/chat.mydomain.com/bin/activate
(chat.mydomain.com) myuser:$ ~ $
With the above steps, you can start deploying NodeJs apps. The next session will help you to manage NodeJS NPM modules from the eenos control panel.
NPM Management
Manage Node.Js Modules on SandBox Apps
This page will help you to manage NodeJS NPM modules on your NodeJs apps. You can install, update, and uninstall NPM modules from this page.
To access this option, Go to the following page,
Node.Js -> NPM Management
This page will show your Node JS apps and an action button to Manage NPM. You may select your domain and click the manage NPM button which will take you to the NPM management for the respective domain.
Install New NPM Module
You may enter the module lists as a line-by-line list or a comma-separated NPM list. You can include the NPM version tag too. After entering all the NPMs, click the button Install Npms.
The Module installation may take some time. You can see the deployment Status from Node.Js -> Node.Js & SandBox Apps
Update Single NPM Module
To update a single NodeJs module, click the Update button for the respective Python module.
Bulk Update Modules
To update multiple NodeJs modules, select the NodeJs modules and click on the Bulk Update button.
Uninstall Single NPM
To remove a single nodejs module, click the Remove button for the respective NPM module.
Bulk Uninstall Module
To remove multiple NodeJs modules, select the NPM modules and click the Bulk Remove button.
Node.Js & SandBox Apps
Manage NodeJs version and SandBox Apps
This page will give an easy interface for managing your NodeJS sandbox apps. To access the apps go to the following page,
Node.Js -> Node.Js & SandBox Apps
This page will provide the following tools :
- Change NodeJs Version
- Change App Startup Script
- Change Public Folder
- Change Project Mode
- Enable/Disable SandBox
Change NodeJs Version on App
To change the NodeJs version of a SandBox app, click the NodeJs icon on the respective app. Then, select the NodeJs version. You can also choose to reinstall Sandbox.
Changing Versions of the Ndoejs App doesn't remove your project NPMs.
Change App Startup Script
This option will help you to change the entry point script or startup script on your NodeJs project. It is a javascript file name.
Examples: app.js, site.js, statup.js etc,.
Change Public Folder
This folder contains the static files of your apps like CSS, JS, Images, etc. If your app configured the static files on a specific folder, you need to set this path, so that the web server directly serves these files.
Change Project Mode
You can switch your project into production or development mode. This mode will be enabled on your web server configuration.
Enable / Disable Sandbox
This option will help you to enable or disable the virtual NodeJS environment on your SandBox app.
Re-Install Sandbox
This option will remove all installed NodeJs on your SandBox and reinstall the app NodeJS virtual environment on your project.
Delete SandBox
This option will uninstall the SandBox from your selected domain.