Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/aarontravass/http_logger
- Owner: aarontravass
- License: mit
- Created: 2023-06-25T20:54:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-28T19:23:31.000Z (over 1 year ago)
- Last Synced: 2024-10-08T02:45:12.453Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://deno.land/x/[email protected]
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
```