Division

Reload JS on server runtime?

Recommended Posts

Is there a way letting the running server reloading my javascript files?

npm run watch

always rebuilds index.js on changes but the server doesn't auto-re-load this file.
Is there a way to enable an event with maybe params?

  • Mask 1

Share this post


Link to post
Share on other sites

You can use a process manager for that (pm2):

npm i -g pm2 # install pm2 

cd /your/ragemp/server-files

pm2 start server.exe --watch # starts the server.exe in watch mode. it will restart on any file changes inside the server-files folder
  
pm2 stop server --watch # its important to stop it with the --watch flag otherwise it will still restart.

pm2 logs server # will show you the logs

 

  • Like 1

Share this post


Link to post
Share on other sites

If you're in development environment just use nodemon :)

nodemon --watch packages --watch client_packages --exec \"./server.exe\"
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.