barbarbar338 / sidra

⚔️ Sidra offers you many decorators for you to use with the Cloudflare Workers.

Home Page:https://barbarbar338.github.io/sidra/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Banner build supportServer totalDownloads weeklyDownloads version stars license

⚔️ SidraJS

Sidra offers you many decorators for you to use with the Cloudflare Workers.

TypeScript definitions are built in.

Installation

  • Run
    $ npm install sidra
    
    or
    $ yarn add sidra
    

Docs

https://barbarbar338.github.io/sidra/

Examples

See https://github.com/barbarbar338/sidra-template

import { type APIRes, Controller, Get, Handle, HTTPStatus } from "sidra";

@Controller()
class MyController {
	@Get()
	get(): APIRes<string> {
		return {
			data: "Hello World",
			message: "Hello World",
			statusCode: HTTPStatus.OK,
		};
	}
}

const handler = Handle([MyController]);

addEventListener("fetch", (event) => {
	event.respondWith(handler(event.request));
});

About

⚔️ Sidra offers you many decorators for you to use with the Cloudflare Workers.

https://barbarbar338.github.io/sidra/

License:GNU General Public License v3.0


Languages

Language:TypeScript 100.0%