{"id":15022436,"url":"https://github.com/dergoogler/burnserve","last_synced_at":"2026-01-31T05:33:03.959Z","repository":{"id":56863653,"uuid":"526586169","full_name":"DerGoogler/BurnServe","owner":"DerGoogler","description":"Fast, zero dependency HTTP Server for Bun.js runtime","archived":false,"fork":false,"pushed_at":"2022-08-21T18:02:29.000Z","size":123,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-01T07:51:06.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/DerGoogler.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":"2022-08-19T11:47:15.000Z","updated_at":"2024-03-29T04:05:26.000Z","dependencies_parsed_at":"2022-08-28T00:13:01.611Z","dependency_job_id":null,"html_url":"https://github.com/DerGoogler/BurnServe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DerGoogler/BurnServe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerGoogler%2FBurnServe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerGoogler%2FBurnServe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerGoogler%2FBurnServe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerGoogler%2FBurnServe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DerGoogler","download_url":"https://codeload.github.com/DerGoogler/BurnServe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerGoogler%2FBurnServe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259377500,"owners_count":22848368,"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":[],"created_at":"2024-09-24T19:57:56.923Z","updated_at":"2026-01-31T05:33:03.901Z","avatar_url":"https://github.com/DerGoogler.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BurnServe\n\nThis library requires [Bun](https://bun.sh)\n\n\u003e This library is currently experimental and under development. Everything can CHANGE!\n\n## Quickstart\n\n```ts\nimport BurnServe from \"burnserve\";\n\nconst app = new BurnServe();\n\napp.get(\"/\", ctx =\u003e {\n  ctx.sendHTML(\"lol\");\n});\n\napp.get(\"/test\", ctx =\u003e {\n  ctx.sendHTML(\"You're on a test page\");\n});\n\napp.get(/\\/public\\/.*/, ctx =\u003e {\n  ctx.sendHTML(\"Public folder\");\n});\n\napp.get(/\\/ab(cd)?e/, ctx =\u003e {\n  ctx.sendHTML(\"You're on a test page\");\n});\n\napp.listen(\n  {\n    port: 3030,\n  },\n  opts =\u003e {\n    console.log(`Server listening on port ${opts.port}`);\n  }\n);\n```\n\n## Documentation\n\n## Any routing\n\nThe helper `anyRoute` make this possible\n\n```ts\nimport BurnServe, { anyRoute } from \"burnserve\";\n\nconst app = new BurnServe();\n\napp.get(anyRoute([\"test\", \"public\"]), ctx =\u003e {\n  ctx.sendHTML(\"Hello, world!\");\n});\n\n// If you don't exclude these path, they won't never show up\napp.get(\"/test\", ctx =\u003e {\n  ctx.sendHTML(\"You're on a test page\");\n});\n\n// Same here\napp.get(/\\/public\\/.*/, ctx =\u003e {\n  ctx.sendHTML(\"Public folder\");\n});\n\napp.listen({\n  port: 3030,\n});\n```\n\n## Custom context\n\n**main.ts**\n\n```ts\nimport { BurnServe } from \"./../src\";\nimport { PPContext } from \"./PPContex\";\n\nconst app = new BurnServe\u003cPPContext\u003e({\n  context: PPContext,\n});\n\n// Exclude public from any rotung\napp.getAR([\"public\"], ctx =\u003e {\n  ctx.log(\"Test log\");\n  ctx.sendHTML(\"Im' up!\");\n});\n\napp.get(/\\/public\\/.*/, ctx =\u003e {\n  ctx.sendHTML(\"Public folder\");\n});\n\napp.listen({\n  port: 3030,\n});\n```\n\n**PPContext.ts**\n\n```ts\nimport { Context } from \"../src\";\n\nexport class PPContext extends Context {\n  public constructor(req: Request) {\n    super(req);\n  }\n\n  public log(text: string): this {\n    console.log(text);\n    return this;\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdergoogler%2Fburnserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdergoogler%2Fburnserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdergoogler%2Fburnserve/lists"}