Script to deploy Express/Node.js server builds through FTP to your cPanel hosting.
This script specifically uploads:
lib/folder (compiled server code) (you can update the folder name)package.json(dependencies)package-lock.json(dependency lock file)
-
Clone this repo
-
Install Deps (
npm install) -
Duplicate
.env.sampleto just.envand populate values -
After making changes in your Express/Node.js project, build it (e.g.,
npm run build) IN THE PROJECT'S folder. -
Come back to this
deploy-nodejs-backenddirectory and run the script (node index.js) and voila!!!