{"id":26027736,"url":"https://github.com/narumincho/http-server","last_synced_at":"2026-05-26T20:32:01.145Z","repository":{"id":275134188,"uuid":"925173766","full_name":"narumincho/http-server","owner":"narumincho","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-31T06:32:38.000Z","size":91,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-31T13:33:44.388Z","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/narumincho.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-31T11:24:37.000Z","updated_at":"2025-05-23T03:44:42.000Z","dependencies_parsed_at":"2025-04-14T04:23:52.040Z","dependency_job_id":"d6b8f91f-a3f6-47e1-9afb-a270cb19c805","html_url":"https://github.com/narumincho/http-server","commit_stats":null,"previous_names":["narumincho/http-server"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/narumincho/http-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Fhttp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Fhttp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Fhttp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Fhttp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narumincho","download_url":"https://codeload.github.com/narumincho/http-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Fhttp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33538659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-03-06T16:57:10.180Z","updated_at":"2026-05-26T20:32:01.139Z","avatar_url":"https://github.com/narumincho.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http-server\n\n[![JSR](https://jsr.io/badges/@narumincho/http-server)](https://jsr.io/@narumincho/http-server)\n\n[Hono](https://github.com/honojs/hono) や\n[Elysia](https://github.com/elysiajs/elysia) とは違い,\nメソッド記法ではなく純粋な関数を組み合わせて作る, 型がついたHTTP サーバー\n\nDeno を使って開発中. まだ機能不足\n\n```ts\nimport {\n  body,\n  createHandler,\n  json,\n  operation,\n  query,\n  requestHeader,\n  response,\n} from \"jsr:@narumincho/http-server\";\nimport {\n  createOpenApi,\n  createOpenApiOperation,\n} from \"jsr:@narumincho/http-server/openApi.ts\";\nimport { createRedocOperation } from \"jsr:@narumincho/http-server/redoc.ts\";\nimport { createScalarOperation } from \"jsr:@narumincho/http-server/scalar.ts\";\n\nconst operations: Parameters\u003ctypeof createHandler\u003e[\"0\"][\"operations\"] = [\n  operation.get({\n    path: \"/items\",\n    description: \"アイテムを一覧で取得します\",\n    queryParameters: {\n      filter: query.optional({\n        description: \"フィルターのパラメーター\",\n        queryItemType: query.string(),\n        example: \"a\",\n      }),\n      withDetail: query.optional({\n        description: \"\",\n        queryItemType: query.boolean(),\n        example: false,\n      }),\n      sampleRequired: query.required({\n        description: \"必須パラメーター テスト\",\n        queryItemType: query.string(),\n        example: \"サンプル必須!\",\n      }),\n    },\n    requestHeaders: [\n      requestHeader.required(requestHeader.authorizationBearer({}), {}),\n    ],\n    responses: [\n      response.ok({\n        description: \"取得結果を返します\",\n        headers: [],\n        content: [\n          body.applicationJson(json.array(json.object({\n            name: json.string(),\n          }))),\n          body.applicationOctetStream(),\n        ],\n      }),\n    ],\n    // deno-lint-ignore require-await\n    handler: async ({ pathParameters, queryParameters, response }) =\u003e {\n      console.log(pathParameters, queryParameters);\n      return response[\"200\"]({}, \"application/json\", [{ name: \"\" }]);\n    },\n  }),\n  operation.post({\n    path: \"/items\",\n    queryParameters: {},\n    responses: [response.ok({\n      headers: [],\n      description: \"結果を返します\",\n      content: [\n        body.applicationJson(json.object({\n          wip: json.string(),\n        })),\n      ],\n    })],\n    // deno-lint-ignore require-await\n    handler: async ({ pathParameters, queryParameters, response }) =\u003e {\n      console.log(pathParameters, queryParameters);\n      return response[\"200\"]({}, \"application/json\", { wip: \"123\" });\n    },\n  }),\n  operation.get({\n    path: \"/items/:id\",\n    queryParameters: {\n      withDetail: query.optional({\n        description: \"詳細情報も取得するかどうか\",\n        queryItemType: query.boolean(),\n        example: false,\n      }),\n    },\n    responses: [response.ok({\n      headers: [],\n      description: \"結果を返します\",\n      content: [\n        body.applicationJson(json.object({\n          wip: json.string(),\n        })),\n      ],\n    })],\n    // deno-lint-ignore require-await\n    handler: async ({ pathParameters, queryParameters, response }) =\u003e {\n      console.log(pathParameters, queryParameters);\n      return response[\"200\"]({}, \"application/json\", { wip: \"123\" });\n    },\n  }),\n  operation.patch({\n    path: \"/items/:id\",\n    responses: [response.ok({\n      headers: [],\n      description: \"結果を返します\",\n      content: [\n        body.applicationJson(json.object({\n          wip: json.string(),\n        })),\n      ],\n    })],\n    // deno-lint-ignore require-await\n    handler: async ({ pathParameters, queryParameters, response }) =\u003e {\n      console.log(pathParameters, queryParameters);\n      return response[\"200\"]({}, \"application/json\", { wip: \"123\" });\n    },\n  }),\n  operation.delete({\n    path: \"/items/:id\",\n    responses: [response.ok({\n      headers: [],\n      description: \"結果を返します\",\n      content: [\n        body.applicationJson(json.object({\n          wip: json.string(),\n        })),\n      ],\n    })],\n    // deno-lint-ignore require-await\n    handler: async ({ pathParameters, queryParameters, response }) =\u003e {\n      console.log(pathParameters, queryParameters);\n      return response[\"200\"]({}, \"application/json\", { wip: \"123\" });\n    },\n  }),\n  createOpenApiOperation({\n    path: \"/openapi\",\n    // deno-lint-ignore require-await\n    handler: async ({ response }) =\u003e\n      response[\"200\"](\n        {},\n        \"application/json\",\n        createOpenApi({\n          info: {\n            title: \"@narumincho/http-server example\",\n            version: \"0.0.1\",\n          },\n          operations,\n        }),\n      ),\n  }),\n  createRedocOperation({ path: \"/redoc\", openApiPath: \"/openapi\" }),\n  createScalarOperation({ path: \"/scalar\", openApiPath: \"/openapi\" }),\n];\n\nDeno.serve(\n  createHandler({\n    operations,\n  }),\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarumincho%2Fhttp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarumincho%2Fhttp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarumincho%2Fhttp-server/lists"}