Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aarontravass/http_logger

Tiny Deno Http Logger middleware
https://github.com/aarontravass/http_logger

Last synced: 22 days ago
JSON representation

Tiny Deno Http Logger middleware

Awesome Lists containing this project

README

        

http_logger - A tiny http logger for Deno

[![CI](https://github.com/aarontravass/http_logger/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/aarontravass/http_logger/actions/workflows/main.yml)

## Example

```ts
const port = 5000;

const app = new Server({
handler: (req, connInfo) => {
const res = new Response('hello', { status: 200 });
logger({ ip: true })(req, res, connInfo);
return res;
},
port: port,
});

console.log(`Listening on localhost:${port}`);
await app.listenAndServe();
```