-
[Node.js]npm, express2018 Mad camp/기술 2019. 1. 4. 12:10
node.js의 훌륭한 개발자들이 만든 라이브러리
{
"name": "NodeTest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}web Framework
반복적으로 등장하는 일들을 도와주는 도구
url파라미터로 무언가 처리
이미지 파일 컴퓨터로 읽어서 사용자에게 제공
보안적 이슈
로그인 기능
Express
Node.js에서 가장 보편적으로 사용하는 Framework
사용하기 편리하지만 배우기 쉽지않음..
현실의 복잡함으로 부터 구원해줌 !
Hello world example
const express = require('express')
// expres 모듈 가져옴
const app = express()
const port = 3000
app.get('/', (req, res) => res.send('Hello World!'))
app.listen(port, () => console.log(`Example app listening on port ${port}!`))my Example
var Express = require('express');
var App = Express();
App.get('/', function(req, res) {
res.end('Hello, World!');
});
App.listen(80, function() {
console.log('Server is listening on port 80');
});'2018 Mad camp > 기술' 카테고리의 다른 글
[MongoDB]정리 (0) 2019.01.05 [Node.js]생활코딩 필기 (0) 2019.01.03 [android] intent 활용 예시 (0) 2018.12.30