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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.