Home > OS >  How to start vue server on boot with raspberry pi?
How to start vue server on boot with raspberry pi?

Time:03-07

I usually start the vue server with npm run serve, but i want to make it start itself at boot time of raspberry pi and i don't know how to do it. I want it to be accessible from my local network.

CodePudding user response:

Raspberry Pi runs as a UNIX machine, so you can use typical entrypoint mechanisms to start your server on boot.

I'd recommend editing your rc.local to run your npm run serve in your terminal:

sudo non /etc/rc.local

Add on a new line:

(cd /path/to/vueapp && npm run serve) &

The additional & at the end forks the process, don't forget this.

then run sudo reboot and you should see your local server running on startup.

  • Related