Better APIs with Deno 🦕
Sequoia is a TypeScript library for creating light and fast web-servers
import { Application, Router, HTTPResponse, ContentType, HTTPStatus } from 'jsr:@sequoia/sequoia'
const app = new Application({ logging: true })
const router = new Router()
router.GET('/', (ctx) => {
const agent = ctx.request.headers.get('User-Agent')
return new HTTPResponse({
status: HTTPStatus.SUCCESS,
type: ContentType.JSON,
body: { ok: true, browser: agent }
})
})
app.useRouter(router)
app.listen({ port: 8080 })
Check out the playground on
Deno Deploy