I am creating a personal site using node. It is going to help me keep track of the ebooks that I am reading.
At the moment, I need to cd to the project folder and run node server.js.
I thought I'd create a shell script and then I'd just have to double click on the file. The file would have the following code:
#!/usr/bin/env bash
node server.js
The first error I've got was that server.js is not found at the root directory, I fixed that by typing the full back, then it threw same error for all the dependencies in the application
(I have never used shell scripting)
Is what I am trying to do possible?
I am assuming you are Linux user.
$HOME/.profileexport MY_COOL_NODE_APP=$HOME/nodejs/app/cool_app
node $MY_COOL_NODE_APP/server.js
So in case if you move your app, you will need to update your .profile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With