0

I have a laravel project on an ubuntu server, I run:

node server.js

so it print on the screen:

Server listening at port XXXX

But what if I need to make a git pull command on the production?

Is there a way for me not to stop the running node service while doing other activity on the server?

kapitan
  • 2,008
  • 3
  • 20
  • 26

2 Answers2

1

You can just open another instance of the terminal and git pull

But why do you want to do this if what you are pulling down from git is currently running? Instead depending on where you are running this (windows/linux) you can create a script which does git pull first and then runs the server.

You can also opt to run the node service in the background. Install node forever package or run it in the background as a Task in windows or a background process in linux. Some discussion here.

na-98
  • 909
  • 8
  • 16
  • sorry for the lack of info. i am using ubuntu server – kapitan Sep 05 '19 at 00:40
  • @kapitan no problem. What I linked to my answer describes many ways to do so including in ubuntu in a native manner or using a node package. And you can also open a new terminal window (or if you are using SSH open a new window and run your git command for quick test) – na-98 Sep 05 '19 at 00:42
0

You can use a other terminal window. If you need to refresh after code Changes, you can use nodemon instead of the Native node command.

pkberlin
  • 812
  • 1
  • 13
  • 31