0.0.4 • Published 11 months ago

nitty-router v0.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

nitty-router

Nitty Router Nesting based without base, powered by itty-router.

tests Version

IttyRouter Badge size

Router Badge size

AutoRouter Badge size

For documentation please refer https://itty.dev/

Use

Use similar to express js middleware function use

Example

const grandchild = Router()
	.get("/", (req) => req)
	.all("*", () => "not found grandchild");

const child = Router()
	.get("/", (req) => req.params.bar)
	.use("grandchild/:name", grandchild)
	.all("*", () => "not found child");

const parent = Router()
	.get("/", () => "parent")
	.use("child/:bar", child)
	.all("*", () => "not found parent");

parent
	.fetch({
		url: "http://localhost/child/kitten/grandchild/mitten",
		method: "GET",
	})
	.then(console.log)
	.catch(console.error);
0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago