Skip to content

gustavofabiane/denorouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno Router

A simple router to build APIs with Deno, built on top of the Deno's standard HTTP library.

Usage

Use server() to initialize and register routes and the 'response' module to generate the response.

import { server } from "https://raw.githubusercontent.com/gustavofabiane/denorouter/master/server.ts"
import { json } from "https://raw.githubusercontent.com/gustavofabiane/denorouter/master/response.ts"

const app = server()
app.get("/hello/:name", (req, { name }) => json({
    hello: `${name}!`
}))

await app.listen()