본문 바로가기

분류 전체보기

(287)
Node.js | PM2 사용하기 PM2 공식 홈페이지 PM2 - Home Advanced process manager for production Node.js applications. Load balancer, logs facility, startup script, micro service management, at a glance. pm2.keymetrics.io PM2 알아보기 PM2를 활용한 Node.js 무중단 서비스하기 - LINE ENGINEERING 자바스크립트는 가장 널리 사용되는 클라이언트 측 프로그래밍 언어이자 프론트엔드 웹 개발 언어 중 하나입니다. 그리고 Node.js는 Chrome의 V8 자바스크립트 엔진으로 빌드된 자바스크립트 런타임(runtime)으로 'Event Driven', 'Non-Blocking I/..
Node.js | Express 사용하기 (기본 Routing) ※ Visual Studio Code 사용 1. NPM(Node Package Manager)을 이용 Express Install $ npm install express --save 2. 서버 생성 및 Hello World 해보기 var express = require('express'); var app = express(); //app.get('/', (req, res) => res.send('Hello Node.js Express')) 로 작성해도 됨 app.get('/', function (req, res) { res.send("Hello Node.js Express"); }); app.listen(3002, function () { console.log('Example app listening o..
Node.js | 파일 시스템(FileSystem) ※ ATOM 에디터 사용 FileSystem 모듈 불러오기 var fs = require('fs'); 파일 생성 및 기입 (writeFile) var fs = require('fs'); fs.writeFile(__dirname + "/test.txt", "여기는 기입할 내용", function (err) { if(err) return console.error(err); console.log("파일 생성 및 기입 성공!"); }) 파일 읽기(readFile) readFileSync // read file sync var fdata1 = fs.readFileSync(__dirname+"/test.txt"); console.log(fdata1.toString()); // read file sync var fd..
Node.js | 웹 서버 만들기 ※ ATOM 에디터 사용 1. main.js 파일 생성 node.js라는 새 폴더를 C드라이브에 생성한 후, 폴더를 열어 main.js라는 파일을 생성하였음 2. 서버 생성 var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type':'text/html; charset=utf-8'}); // 상태코드 200 == success res.write('hello node.js'); console.log(__dirname); res.end(); }).listen(3002); 3. command 실행 (Window 키 + R) +) 다른방법(Express) var express = requi..
ATOM 설치하기 1. ATOM 다운로드 A hackable text editor for the 21st Century At GitHub, we’re building the text editor we’ve always wanted: hackable to the core, but approachable on the first day without ever touching a config file. We can’t wait to see what you build with it. atom.io 2. 설치 +) 설치 참고 영상 설치 - Atom Editor 설치 2015-05-19 00:34:22 opentutorials.org
Node.js | 다운로드 및 설치 1. Node.js 다운로드 Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 2. 설치 +) 설치가 잘 되었는지 확인하기 윈도우 키 + R으로 실행창을 띄우고 cmd입력 node -v입력: 설치된 Node.js의 버전 확인 node입력: Node.js실행
Visual Studio Code 다운로드 및 한글설정 1. Visual Studio Code 사이트 접속 Visual Studio Code - Code Editing. Redefined Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. code.visualstudio.com 2. 다운로드 다운로드한 파일은 압축을 풀어줍니다. 3. 설치 별도의 install과정은 없으며 exe파일을 실행시켜 바로 사용할 수 있습니다. +) ..