728x90
반응형
const express = require('express')
const app = express();
app.use((req, res, next) =>{
console.log('미들웨어 1을 통과하고 있습니다.');
next();
});
app.use((req, res, next) => {
console.log('미들웨어 2를 통과하고 있습니다. ');
next();
})
app.get('/', function(req,res) {
res.send('hello world')
})
app.get('/hello', function(req,res) {
res.send('hello again...')
})
app.listen(3010)
console.log('server is running')
========================================================================
728x90
반응형
'IT > JavaScript와 Framework' 카테고리의 다른 글
postman chrome 플러그인 설치 (0) | 2021.06.17 |
---|---|
morgan 설치 (0) | 2021.06.17 |
nodemon 모듈 - 서버 자동 재기동 모듈 (0) | 2021.06.16 |
express 프레임웍 샘플 2 - 클라이언트 요청받아 응답받기 (0) | 2021.06.16 |
express 프레임 웍 사용예제 (0) | 2021.06.16 |
댓글