A Simple Router for Deno (https://deno.land/x/rute)
- deno 1.0.2
0.11
- Rute for Deno v1.0.00.12
- Optional middlewares0.13
- CORS middleware, deps.ts, static glob
master
- Recent Release0.x
- Development branch for version 0.x
import {
Server,
Request,
Response,
Middleware,
Next
} from "https://deno.land/x/rute/mod.ts";
deno run --allow-net --allow-read "https://deno.land/x/rute/example/basic/app.ts"
import {
Server,
Request,
Response
} from "https://deno.land/x/rute/mod.ts";
const app: Server = new Server();
app.get("/", (req: Request, res: Response) => {
res.set({"message": "Hello World!"});
});
app.listen({ port: 8000 });
/**
* Index page
*/
app.all("/", async (req: Request, res: Response) => {
let data = await fetch("https://hacker-news.firebaseio.com/v0/item/2921983.json?print=pretty");
let json = await data.json();
console.log(json);
res.set(json);
});
import { app as secondApp } from "../second_app/app.ts";
/**
* Root application
*
* path: /
*/
const app: Server = new Server("multi_app");
/**
* Second application
*
* path: /second
*/
app.use(secondApp.rebase("second"));
We have few examples provided, that could be found here.
Our wiki is located here
To contribute to Rute! Make sure to give a star and forked this repository. Current development branch is 0.x
, so make sure to checkout it.
Alternatively see the GitHub documentation on creating a pull request.
The Rute
is open-sourced software licensed under the MIT license.