-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11725c2
commit 2956c8a
Showing
5 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# deno-http-logger - A tiny, 0 Dependency http logger for Deno | ||
|
||
## Example | ||
```ts | ||
const port = 5000 | ||
|
||
const app = new Server({ | ||
handler: (req) => { | ||
const res = new Response("hello", { status: 200 }); | ||
logger({ ip: true })(req, res); | ||
return res; | ||
}, | ||
port: port | ||
}); | ||
|
||
console.log(`Listening on localhost:${port}`) | ||
await app.listenAndServe() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Server } from "./dev_depts.ts"; | ||
import { logger } from "./mod.ts"; | ||
|
||
const port = 5000 | ||
|
||
const app = new Server({ | ||
handler: (req) => { | ||
const res = new Response("hello", { status: 200 }); | ||
logger({ ip: true })(req, res); | ||
return res; | ||
}, | ||
port: port | ||
}); | ||
|
||
console.log(`Listening on localhost:${port}`) | ||
await app.listenAndServe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters