-
Node Express JS 로 서버 만들기개발 2020. 6. 5. 22:30
node js의 express framework로 너무나 간단히 서버를 만들 수 있다.
1. node 설치
2. npm init (패키지 초기화)
3. package.json 확인
4. npm install --save express (express js 추가)
5. server.js (서버가 될 파일을 만든다)
const express = require('express'); const app = express(); const port = 3000; app.get('/', (req, res, next) => { res.send('hello world!'); }); app.listen(port, () => { console.log(`Listnening Server is running at ${port}`); });
6. node server.js(서버 실행)
'개발' 카테고리의 다른 글
swagger spring boot (0) 2020.06.08 AWS mariaDB 생성하기(feat. Freetier, 파라미터 그룹 생성) (0) 2020.06.07 구동 시 오류 DirectJDKLog.java:173 Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [406,307] milliseconds. (0) 2020.06.04 git start (0) 2020.05.28 npm install ERROR (0) 2020.05.28