{"id":25738509,"url":"https://github.com/anzerr/http.ts","last_synced_at":"2025-02-26T07:32:35.425Z","repository":{"id":49166156,"uuid":"181524277","full_name":"anzerr/http.ts","owner":"anzerr","description":"Simple http server in ts","archived":false,"fork":false,"pushed_at":"2022-10-26T13:27:37.000Z","size":214,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T06:35:40.778Z","etag":null,"topics":["decorators","http","nodejs","ts","typescript","util"],"latest_commit_sha":null,"homepage":"","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/anzerr.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":"2019-04-15T16:20:34.000Z","updated_at":"2022-01-21T16:37:22.000Z","dependencies_parsed_at":"2023-01-20T13:46:22.672Z","dependency_job_id":null,"html_url":"https://github.com/anzerr/http.ts","commit_stats":null,"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzerr%2Fhttp.ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzerr%2Fhttp.ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzerr%2Fhttp.ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anzerr%2Fhttp.ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anzerr","download_url":"https://codeload.github.com/anzerr/http.ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240811995,"owners_count":19861529,"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","http","nodejs","ts","typescript","util"],"created_at":"2025-02-26T07:31:36.519Z","updated_at":"2025-02-26T07:32:35.350Z","avatar_url":"https://github.com/anzerr.png","language":"TypeScript","readme":"\n### `Intro`\n![GitHub Actions status | publish](https://github.com/anzerr/http.ts/workflows/publish/badge.svg)\n\nDecorator for a simple http server\n\n#### `Install`\n``` bash\nnpm install --save git+https://github.com/anzerr/http.ts.git\nnpm install --save @anzerr/http.ts\n```\n\n### `Example`\n``` javascript\nimport 'reflect-metadata';\nimport {Server, Controller, Get} from 'http.ts';\nimport {Injectable, Inject, Module} from 'inject.ts';\n\n@Injectable()\nclass Log {\n\tcount: number;\n\n\tconstructor() {\n\t\tthis.count = 0;\n\t}\n\n\tinfo(...arg) {\n\t\tthis.count += 1;\n\t\treturn console.log(this.count, ...arg);\n\t}\n\n}\n\n@Controller('user')\nclass Test extends Server.Controller {\n\t@Inject(Log)\n\tlogger: Log;\n\n\t@Get()\n\tlist() {\n\t\tthis.logger.info('list');\n\t\tthis.res.status(200).send('1');\n\t}\n\n\t@Get(':id')\n\tgetUser() {\n\t\tthis.logger.info('getUser');\n\t\tthis.res.status(200).send('2');\n\t}\n\n\t@Get(':id/friends')\n\tgetFriends() {\n\t\tthis.logger.info('getFriends');\n\t\tthis.res.status(200).send('3');\n\t}\n\n}\n\nnew Server(3000)\n\t.withController([Test])\n\t.start();\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanzerr%2Fhttp.ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanzerr%2Fhttp.ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanzerr%2Fhttp.ts/lists"}