Projets
À propos
A minimal and fast HTTP server framework for Deno.
Systèmes et infrastructureProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalAqua
Aqua is a minimal and fast web framework.
:warning: This version is a WIP and has not yet been released. Please refer to the main branch for the current documentation.
Example usage
It starts easy,
import { Aqua } from "...";
const app = new Aqua({
listen: {
port: 80,
},
});
app.route("/").respond(Method.GET, (_event) => {
return new Response("Hello, World!");
});
... and stays easy.
const v1 = app.route("/v1").step(async (event) => {
if (!event.request.headers.has("X-Api-Key")) {
event.response = Response.json(
{ error: "MISSING_API_KEY" },
{
status: 400,
}
);
return event.end();
}
const user = await getUserByRequest(event.request);
// ^ type User
return {
...event,
user,
};
});
v1.route("/user").respond(Method.GET, (event) => {
return Response.json({ data: { user: event.user } });
// ^ type User
});
Explorer des projets similaires
Chargement…