설치 결과를 확인하기 위해서, 실행시 결과가 나오지 않았다.
이유가 뭘까????
=====================================================
const express = require('express')
const morgan = require('morgan')
const app = express();
app.use(morgan('combined'));
pp.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')
:~/Projects/NodeJS/express-first$ npm i morgan
npm WARN express-first@1.0.0 No description
npm WARN express-first@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ morgan@1.10.0
added 4 packages from 2 contributors and audited 172 packages in 2.165s
11 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
=====================================================
╭────────────────────────────────────────────────────────────────╮
│ │
│ New major version of npm available! 6.14.13 → 7.17.0 │
│ Changelog: https://github.com/npm/cli/releases/tag/v7.17.0 │
│ Run npm install -g npm to update! │
│ │
╰────────────────────────────────────────────────────────────────╯
mhchae3@mhchae3-900X3L:~/Projects/NodeJS/express-first$
'IT > JavaScript와 Framework' 카테고리의 다른 글
postman 사용법 (0) | 2021.06.17 |
---|---|
postman chrome 플러그인 설치 (0) | 2021.06.17 |
미들웨어 사용 예제 (0) | 2021.06.17 |
nodemon 모듈 - 서버 자동 재기동 모듈 (0) | 2021.06.16 |
express 프레임웍 샘플 2 - 클라이언트 요청받아 응답받기 (0) | 2021.06.16 |
댓글