import { Kyuko } from "https://dotland.deno.dev/x/kyuko@v0.6.3/mod.ts";
An ultra-light framework for http servers hosted on Deno Deploy. Visit the guide for more information.
Methods
Registers a handler
that is invoked when
any type of requests are made to url paths that match the routePath
.
Registers a default handler
that is invoked when
a request isn't caught by any other custom handlers.
Registers a handler
that is invoked when
DELETE requests are made to url paths that match the routePath
.
Adds errorHandler
to a list of application-level error handlers.
Error handlers are invoked in order of addition via error()
.
Note that in Express, you call
use()
instead.
Registers a handler
that is invoked when
GET requests are made to url paths that match the routePath
.
app.get('/', (req, res) => {
const { name } = req.query;
res.send(`Hello ${name}!`);
});
Registers a handler
that is invoked when
HEAD requests are made to url paths that match the routePath
.
app.head("/", (_, res) => {
res.headers.append("content-type", "text/plain;charset=UTF-8");
res.headers.append("content-length", "12");
res.send();
});
Registers a handler
that is invoked when
PATCH requests are made to url paths that match the routePath
.
Registers a handler
that is invoked when
POST requests are made to url paths that match the routePath
.
Registers a handler
that is invoked when
PUT requests are made to url paths that match the routePath
.
app.put('/users/:id', (req, res) => {
const { id } = req.params;
// ...
res.status(204).send(`Updated ${id}!`);
});
Adds middleware
to a list of application-level middleware to run.
Middleware are invoked in order of addition via use()
.