{"id":23090255,"url":"https://github.com/ahmedalyousif/meteorite","last_synced_at":"2026-05-15T23:05:03.554Z","repository":{"id":57675331,"uuid":"266585631","full_name":"AhmedAlYousif/meteorite","owner":"AhmedAlYousif","description":"a framework to build REST APIs in Deno runtime.","archived":false,"fork":false,"pushed_at":"2020-07-06T19:56:06.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-14T19:36:10.303Z","etag":null,"topics":["decorators","deno","framework","rest-api","typescript"],"latest_commit_sha":null,"homepage":"https://deno.land/x/meteorite","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AhmedAlYousif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-24T16:57:22.000Z","updated_at":"2020-07-06T19:56:08.000Z","dependencies_parsed_at":"2022-09-26T20:41:32.386Z","dependency_job_id":null,"html_url":"https://github.com/AhmedAlYousif/meteorite","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/AhmedAlYousif/meteorite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedAlYousif%2Fmeteorite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedAlYousif%2Fmeteorite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedAlYousif%2Fmeteorite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedAlYousif%2Fmeteorite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AhmedAlYousif","download_url":"https://codeload.github.com/AhmedAlYousif/meteorite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedAlYousif%2Fmeteorite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264357294,"owners_count":23595576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decorators","deno","framework","rest-api","typescript"],"created_at":"2024-12-16T20:52:43.442Z","updated_at":"2026-05-15T23:04:58.533Z","avatar_url":"https://github.com/AhmedAlYousif.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![test](https://github.com/AhmedAlYousif/meteorite/workflows/test/badge.svg)](https://github.com/AhmedAlYousif/meteorite/actions?query=workflow%3Atest)\n\n# Meteorite\n### A framework to build REST APIs in [Deno](https://deno.land/) runtime.\n\n## Example\n\n`myServer.ts`\n```typescript\nimport { Meteorite } from 'https://deno.land/x/meteorite@vx.x.x/src/meteorite.ts';\nimport { MeteorServer } from 'https://deno.land/x/meteorite@vx.x.x/src/decorators/decorators.ts';\nimport { Hello } from './helloController.ts';\n\n@MeteorServer({\n    address: { port: 8080 },\n    controllers: [\n        Hello\n    ]\n})\nclass MyServer { }\n\n//start the server\nMeteorite.startServer(new MyServer());\n```\n### Handle request using `ServerRequest`:\n`helloController.ts`\n```typescript\nimport { Controller, Request } from \"https://deno.land/x/meteorite@vx.x.x/src/decorators/decorators.ts\";\nimport { ServerRequest } from \"https://deno.land/x/meteorite@vx.x.x/src/package.ts\";\n\n@Controller('')\nexport class Hello {\n\n    @GetRequest('/hello')\n    myRequest(req: ServerRequest){\n        req.respond({body: 'hi'});\n    }\n}\n```\n### Handle request using `@PathParam` or `@QueryParam`:\n`helloController.ts`\n```typescript\nimport { Controller, Request } from \"https://deno.land/x/meteorite@vx.x.x/src/decorators/decorators.ts\";\nimport { ServerRequest } from \"https://deno.land/x/meteorite@vx.x.x/src/package.ts\";\n\n@Controller('')\nexport class Hello {\n\n    @GetRequest('/:greeting')\n    greet(\n        @PathParam('greeting') greeting:string,\n        @QueryParam('name', false) name:string\n    ){\n        if(name == null){\n            return `${greeting} there!`;\n        } else {\n            return `${greeting} ${name}!`;\n        }\n    }\n}\n```\n\n`tsconfig.json`\n```json\n{\n  \"compilerOptions\": {\n    \"experimentalDecorators\": true\n  }\n}\n```\n\n### run\n`deno run --allow-net -c tsconfig.json myServer.ts`\n\nThen try the browser `http://localhost:8080/hello`\n\n\n## More on `@Param`, `@PathParam` \u0026 `@QueryParam`\n\n### Get all path param or query params\n```typescript\n  method(@Param(type:'PATH') pathParams:any){\n\n  }\n  //or\n  method(@PathParam() pathParams:any){\n    \n  }\n```\nso if you have `/path/:param/:id`\nyou will can get the path param values like:\n`pathParam.param` \u0026 `pathParam.id`\n\nYou can do the same for the query params:\n```typescript\n  method(@Param(type:'QUERY') queryParams:any){\n\n  }\n  //or\n  method(@QueryParam() queryParams:any){\n    \n  }\n```\n\n### Get one param\n```typescript\n  method(@Param({param:{paramName:'id'}, type:'PATH'}) id:string){\n\n  }\n  //or\n  method(@PathParam('id') id:string){\n    \n  }\n\n  //this will throw error. path params can not be not required\n  method(@Param({param:{paramName:'id', required:false}, type:'PATH'}) id:string){\n\n  }\n```\n\n```typescript\n  method(@Param({param:{paramName:'id'}, type:'QUERY'}) id:string){\n\n  }\n  //or\n  method(@QueryParam('id') id:string){\n    \n  }\n\n  //not required\n  method(@Param({param:{paramName:'id', required:false}, type:'QUERY'}) id:string){\n\n  }\n  //or\n  method(@QueryParam('id', false) id:string){\n    \n  }\n```\n\nif the method is using one of those decorators to handle the request it should return the required body where  `body: Uint8Array | Reader | string` or an object of type [`Response`](https://deno.land/std/http/server.ts#L350);\n\nif the handler only return the body, the status code will always be `200` as long as there is no error.\n\n## TODO\n\n### Decorators:\n-   [x] `@MeteorServer`\n-   [x] `@Controller`\n-   [x] `@Request` [`@GetRequest`, `@PostRequest`, `@DeleteRequest`, `@PutRequest`]\n-   [x] `@Param` [`@PathParam`, `@QueryParam`]\n-   [ ] `@ServerRequest`\n-   [ ] `@Body`\n-   [ ] `@Header`\n-   [ ] `@Accepts`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedalyousif%2Fmeteorite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedalyousif%2Fmeteorite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedalyousif%2Fmeteorite/lists"}