A simple routing framework for Deno for serving simple websites. Created specifically as part of building https://crunchskills.com/
- Serve text endpoints
- Dynamic endpoints
- Simple API
- Probably lots of bugs!
- Super sweet
import { serve, Server, ServerRequest } from "https://deno.land/std/http/server.ts";
import { tasty } from 'https://raw.githubusercontent.com/jquave/tasty/master/tasty.ts';
const s: Server = serve({ port: 8000 });
let router = new tasty.Router();
// Serve a static endpoint
router.get('/',
(request: ServerRequest) => request.respond({ body: `Hello World!` })
);
// Serve a dynamic permalink
router.get('/:name',
(request: ServerRequest, query) => request.respond({ body: `Hello ${query.get("name")}` })
);
console.log("π¦ tasty! π¦")
console.log("Serving up some tasty routes")
for await (const request of s) {
router.route(request);
}
Run with
deno run --allow-net web.ts
If you want to contribute to this project, feel free to make a fork, make changes on your fork, and then open a pull request here with an explanation of your changes.
- Handlebars templates
- Static folder handling
- Authentication system with SQLite built-in
- Github authentication