Fall in IT.

실행중인 Node.js 프로그램 자동재시작 프로그램 Supervisor 본문

프로그래밍언어/Node.js

실행중인 Node.js 프로그램 자동재시작 프로그램 Supervisor

D.Y 2016. 4. 5. 02:06

오늘은 Supervisor란 application에 대해 알아보겠습니다.



Supervisor 공식 문서에 아래와 같이 설명되어 있습니다.

"A supervisor program for running nodejs programs"

"A little supervisor script for nodejs. It runs your program, and watches for code changes, so you can have hot-code reloading-ish behavior, without worrying about memory leaks and making sure you clean up all the inter-module references, and without a whole new require system."


간단히 말하면, Supervisor는  실행중인 Node.js 어플리케이션을 위한 프로그램 입니다. 


만약 Node.js를 사용하여 웹어플리케이션을 개발한다고 했을때, 라우터 추가 혹은 컨트롤러(즉, 소스코드) 변경 시
웹어플리케이션을 재실행해야 적용되었습니다.


그러나 해당 프로그램을 사용하면 코드 변경이 있을때마다 자동으로 어플리케이션을 재실행 해줌으로써
프로그래머의 수고(?)를 한층 덜어주는 프로그램 입니다.



Supervisor 설치방법

  • npm intall supervisor -g (모든경로에서 사용 할 수 있도록 설치됩니다.)


Supervisor 사용방법

  • supervisor {app_name}
    - ex. supervisor app.js


    - 일반적인 node.js 어플리케이션 실행 화면.


    -supervisor를 사용하여 node.js 어플리케이션 실행한 화면.


    -에디터에서 소스코드 변경 후, 저장버튼을 눌렀을 때 화면. (재실행됬음을 확인 할 수 있습니다)

자세한 내용은 아래 링크를 참조해 주세요.


Node.js 어플리케이션 개발을 하는 개발자들에게 유용하게 사용 될 수 있을 것 같습니다.


모두 즐거운 코딩하세요~



Comments