sovrin / teda

small middleware for logging HTTP requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

teda

npm version types size coverage vulnerabilities dependencies devDependencies License

small middleware for logging HTTP requests

Installation

$ npm i teda

Usage

import express from 'express';
import teda from 'teda';

const app = express();
app.use(teda(':method :url :status :content-length - :duration ms'));

app.get('/', (req, res) => {
    res.send('hello world!')
});

Predefined Formats

default

:remote-addr - [:date] ":method :url HTTP/:http-version" :status :content-length - :duration ms

tiny

:method :url :status :content-length - :duration ms

Tokens

  • :remote-addr
  • :method
  • :url
  • :http-version
  • :user-agent
  • :status
  • :date
  • :content-length
  • :duration

Licence

MIT License, see LICENSE

About

small middleware for logging HTTP requests

License:MIT License


Languages

Language:TypeScript 100.0%