{"id":19986165,"url":"https://github.com/fuse-box/fuse-http","last_synced_at":"2025-10-09T07:11:28.007Z","repository":{"id":57243274,"uuid":"112470954","full_name":"fuse-box/fuse-http","owner":"fuse-box","description":"A lightweight HTTP server implementation based on express with simplicity in mind.","archived":false,"fork":false,"pushed_at":"2018-08-11T19:30:45.000Z","size":33,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-05T16:36:05.589Z","etag":null,"topics":["fuse-box","http","http-server","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fuse-box.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-29T12:09:15.000Z","updated_at":"2025-03-24T03:00:15.000Z","dependencies_parsed_at":"2022-09-15T09:02:40.679Z","dependency_job_id":null,"html_url":"https://github.com/fuse-box/fuse-http","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fuse-box/fuse-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuse-box%2Ffuse-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuse-box%2Ffuse-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuse-box%2Ffuse-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuse-box%2Ffuse-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuse-box","download_url":"https://codeload.github.com/fuse-box/fuse-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuse-box%2Ffuse-http/sbom","scorecard":{"id":414351,"data":{"date":"2025-08-11","repo":{"name":"github.com/fuse-box/fuse-http","commit":"6300e50bb2bbd7b2bdfaf9af04e8935b24d94465"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"54 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-6pq3-928q-x6w6","Warn: Project is vulnerable to: GHSA-7qgg-vw88-cc99","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T23:26:18.295Z","repository_id":57243274,"created_at":"2025-08-18T23:26:18.295Z","updated_at":"2025-08-18T23:26:18.295Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000982,"owners_count":26082971,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["fuse-box","http","http-server","typescript"],"created_at":"2024-11-13T04:28:10.927Z","updated_at":"2025-10-09T07:11:27.990Z","avatar_url":"https://github.com/fuse-box.png","language":"TypeScript","readme":"# FuseHTTP\n\nFuseHTTP is a lightweight HTTP server implementation based on express with simplicity in mind.\n\n```ts\nimport { Route } from 'fuse-http';\n@Route(\"/\")\nexport class MainRoute {\n    public async get(req) {\n        return \"hello world\";\n    }\n}\n```\n\n## Key features\n\n* Simple setup\n* Decorator based\n* Automatic dependency injections by name\n* Custom error handling\n\n\n```bash\nnpm install fuse-http --save\n```\n## Getting started\n\nYou would need fuse.js configuration to bundle and start your project. So let's create `fuse.js` first\n\n`fuse.js`\n\n```js\nconst { FuseBox } = require(\"fuse-box\");\nconst fuse = FuseBox.init({\n    homeDir: \"src\",\n    target: \"server@esnext\",\n    output: \"dist/$name.js\"\n});\nfuse.bundle(\"app\")\n    .instructions(\"\u003e[index.ts]\")\n    .watch().completed(proc =\u003e proc.start())\nfuse.run();\n```\n\nNow let's create our application entry point\n\n`index.ts`\n\n\n```ts\nimport { Server } from \"fuse-http\";\n\n// just import the route module here\nimport './routes/MainRoute';\n\n// start the server\nServer.start({ port: 3001 });\n```\n\n\nSample route: `routes/MainRoute`\n\n\n```ts\nimport { Route } from 'fuse-http';\n\n@Route(\"/\")\nexport class MainRoute {\n    public get(req) {\n        return \"hello world\";\n    }\n}\n```\n\n## Routing\n\n\n```ts\nimport { Route } from 'fuse-http';\n\n@Route(\"/\")\nexport class MainRoute {\n    public async get(req) {\n        return \"hello world\";\n    }\n    public async post() {\n        return {};\n    }\n    public async anyOtherHTTPMethod() {\n        return \"any other\";\n    }\n}\n```\n\nHTTPMethod name must be found in the Route class, once matched it will be executed (with dependency injections).\n\nYou can return any kind of object, it will be serialised to JSON if possible. (strings for example will be printed as is)\n\n## Dependency injections\n\nThe framework comes with default dependency injections to make your life easier.\n\n| Name        | Object\n| ------------- |:-------------|\n| req      | Express.req\n| res      | Express.res\n| next | Express.next\n\nTHe order should not matter, the only thing what matter is naming. For example the following example should work just fine.\n\n```ts\n@Route(\"/\")\nexport class MainRoute {\n    public async get(next: express.NextFunction) {\n        return \"hello world\";\n    }\n}\n```\n\n### Creating your first injection\nThe following module must be imported in your entry point.\n\n```ts\nimport { Injector } from \"fuse-http\";\n\n@Injector(\"foo\")\nclass Foo {\n    private inject(req : express.Request) {\n        return this;\n    }\n    public helloWorld(){\n        return { hello : \"world\" }\n    }\n}\n```\n\nNow as we registered the injector, we can now use it.\n\n```ts\n@Route(\"/\")\nexport class MainRoute {\n    public async get(foo: Foo) {\n        return foo.helloWorld() // will render { hello : \"world\" }\n    }\n}\n```\n\nHere FuseBox magically resolved the first parameter, evaluated `inject` method.\n\n\n `inject` method is resolved accordingly, respecting other injections recursively. So you can inject `req` `res` or `next` injections too.\n\n\n## Decorators\n\nDefine your decorator by providing a class with init function to a wrapper `MethodDecorator`\n\n```ts\nimport { MethodDecorator } from \"fuse-http\";\n\nexport const Permissions = MethodDecorator\u003cstring\u003e(class {\n    init(req) {\n       if (!req.query.foobar){\n           throw { message : \"Foobar must be there\" }\n       }\n    }\n})\n```\n`init` will be constucted with all your injections including `req` and `res` from `express`\n\n\nUsage in route\n\n```ts\n@Route(\"/\")\nclass TestRoute {\n\n    @Permissions(\"sdf\")\n    public async get() {\n      return {ok : true};\n    }\n}\n```\n\n## Error handlers\n\nA handler must have `test` method, where we test if that particular exception should be processed. For example, here is `BaseHandler`\n\n```ts\n@ErrorHandler()\nexport class ErrorBaseHandler {\n    public express : ExpressData;\n    public test(e){\n        const res = this.express.res;\n        if ( e instanceof ErrorNotFound){\n            res.status(404).send({code : 404, message : e.message})\n        }\n    }\n}\n```\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuse-box%2Ffuse-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuse-box%2Ffuse-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuse-box%2Ffuse-http/lists"}