본문 바로가기
반응형

node3

Node.js HTTP Request 보내기 (with request.js) 1. HTTP GET 요청 1) 단순 GET 요청 (1) Code const request = require('request'); // Get 요청하기 http://www.google.com const options = { uri: "http://www.google.com" }; request.get(options, function (error, response, body) { //callback }); (2) Payload 2) Query String을 포함한 GET 요청 (1) Code const request = require('request'); // Get 요청하기 http://www.google.com?id=1000 const options = { uri: "http://www.google.c.. 2019. 7. 16.
Nodejs Forever 모듈 설치 및 기본 사용법 Nodejs Forever 모듈 설치 및 사용법 Nodejs는 기본적으로 단일 쓰레드 방식으로 동작하기 때문에 개발 과정에서 별도의 처리를 해주지 않을 경우 서비스 도중 예외가 발생하면 서버가 비정상 종료될 가능성이 높다. 이러한 상황에서 지속적으로 서버를 재실행 시켜주는 방법중 하나는 nodejs의 forever모듈을 사용하는 것인데 이번 글에서는 forever 모듈의 설치 ln -s /opt/nodejs/node-v10.14.1-linux-x64/bin/forever /usr/bin/forever방법과 사용법을 정리하였다. 참고 1) Linux 환경에서 Nodejs 설치하기2018/12/05 - [IT일반/Linux] - Linux에 nodejs 설치하기 1) forever 모듈 설치하기(1) 설치#.. 2018. 12. 6.
Linux에 nodejs 설치하기 Linux에 nodejs 설치하기 Nodejs는 기존에 웹브라우저에서 주로 사용되던 Client-Side Script언어인 Javascript를 Server-Side에서 사용 가능하도록 Chrome의 V8 Javascript 엔진으로 빌드된 런타임입니다. 이 글은 Linux 환경에서 Binary 형태로 제공된 Nodejs 설치 법을 간단히 정리하였습니다. 1) nodejs 다운로드 (https://nodejs.org/en/download/) # cd /opt/# mkdir nodejs# wget https://nodejs.org/dist/v10.14.1/node-v10.14.1-linux-x64.tar.xz 2) 압축해제# xz -d node-v10.14.1-linux-x64.tar.xz# tar xf .. 2018. 12. 5.
반응형