I'm pretty new to the Linux world, I have a Node application that I would like to distribute through an apt repository, this is what I do for now:
- Put the node binary inside the Node application folder.
- Use fpm to build a .deb package which extracts the node code in /opt/myNodeApplication and a sh script called "myNodeApplication" in /usr/local/bin.
The script is something like this:
#!/bin/bash
cd /opt/myNodeApplication
./node app.js
This allow me to call myNodeApplication from the shell from anywhere.
The problem is that I doubt this is the correct way to do it so I would like to have some input on my solution, the questions are:
- Is it ok to extract the node application in /opt/myNodeApplication? or is there a better place?
- Where should I put the script to launch the application? I'm pretty sure /usr/local/bin is not the right place since the script is not a "bin".
- Is there a better way to do the whole thing? Maybe not using a script at all?
Thank you a lot in advance.