Skip to content

Commit

Permalink
3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
djedjehasi committed Jul 10, 2024
1 parent 1398082 commit 146ab57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ morgan = require('morgan')
const app = express()

app.use(express.json())

morgan.token('content', (request, response) => {return JSON.stringify(request.body)})
morgan.format('customTiny', ':method :url :status :res[content-length] - :response-time ms :content');
app.use(morgan('customTiny'))
let persons = [
{
"id": "1",
Expand All @@ -29,7 +31,7 @@ let persons = [

let info = `<p>Phonebook has info for ${persons.length} people</p> <p>${Date()}</p>`

app.get('/info', morgan('tiny'), (request, response) => {
app.get('/info', (request, response) => {
response.send(info)
})

Expand Down

0 comments on commit 146ab57

Please sign in to comment.