https://github.com/barbarbar338/sidra
⚔️ Sidra offers you many decorators for you to use with the Cloudflare Workers.
https://github.com/barbarbar338/sidra
api api-builder application-programming-interface cloudflare cloudflare-worker cloudflare-workers controller decorator decorator-framework decorators reastapi rest-api sidra ts typescript worker workers
Last synced: 10 months ago
JSON representation
⚔️ Sidra offers you many decorators for you to use with the Cloudflare Workers.
- Host: GitHub
- URL: https://github.com/barbarbar338/sidra
- Owner: barbarbar338
- License: gpl-3.0
- Created: 2020-12-21T17:52:14.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T13:39:59.000Z (about 3 years ago)
- Last Synced: 2024-05-01T16:53:14.284Z (almost 2 years ago)
- Topics: api, api-builder, application-programming-interface, cloudflare, cloudflare-worker, cloudflare-workers, controller, decorator, decorator-framework, decorators, reastapi, rest-api, sidra, ts, typescript, worker, workers
- Language: TypeScript
- Homepage: https://barbarbar338.github.io/sidra/
- Size: 514 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://github.com/barbarbar338/sidra)
[](https://discord.gg/BjEJFwh)
[](http://npmjs.com/sidra)
[](http://npmjs.com/sidra)
[](http://npmjs.com/sidra)
[](https://github.com/barbarbar338/sidra)
[](https://github.com/barbarbar338/sidra)
## ⚔️ SidraJS
Sidra offers you many [decorators](https://stackoverflow.com/tags/javascript-decorators/info) for you to use with the [Cloudflare Workers](https://workers.cloudflare.com/).
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
```ts
import { type APIRes, Controller, Get, Handle, HTTPStatus } from "sidra";
@Controller()
class MyController {
@Get()
get(): APIRes {
return {
data: "Hello World",
message: "Hello World",
statusCode: HTTPStatus.OK,
};
}
}
const handler = Handle([MyController]);
addEventListener("fetch", (event) => {
event.respondWith(handler(event.request));
});
```