{"id":23819880,"url":"https://github.com/kth/http-responses","last_synced_at":"2025-08-19T06:33:55.097Z","repository":{"id":40567083,"uuid":"252277679","full_name":"KTH/http-responses","owner":"KTH","description":"Simple ways of returning responses in a declarative way without status codes. Note that it is not async so use it for simple smal stuff.","archived":false,"fork":false,"pushed_at":"2023-09-29T04:19:14.000Z","size":277,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-06T09:50:28.975Z","etag":null,"topics":["http","javascript","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/KTH.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":"2020-04-01T20:17:38.000Z","updated_at":"2022-01-03T19:15:34.000Z","dependencies_parsed_at":"2025-08-19T06:32:32.294Z","dependency_job_id":null,"html_url":"https://github.com/KTH/http-responses","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KTH/http-responses","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fhttp-responses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fhttp-responses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fhttp-responses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fhttp-responses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KTH","download_url":"https://codeload.github.com/KTH/http-responses/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fhttp-responses/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271113403,"owners_count":24701609,"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-08-19T02:00:09.176Z","response_time":63,"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":["http","javascript","npm"],"created_at":"2025-01-02T07:16:15.149Z","updated_at":"2025-08-19T06:33:55.065Z","avatar_url":"https://github.com/KTH.png","language":"JavaScript","readme":"# HTTP Responses ![alt text](https://api.travis-ci.org/KTH/http-responses.svg?branch=master) ![Continous Integration](https://github.com/KTH/http-responses/actions/workflows/main.yml/badge.svg)\n\nNpm: `@kth/http-responses`\n\nSimple ways of returning responses in a declarative way without status codes.\nNote that it is not async so use it for simple smal stuff.\n\n\n## Demo application\n\n[Demo code source here](https://github.com/KTH/http-responses/tree/master/demo-app/).\n\n\n```javascript\nconst express = require(\"express\");\nconst httpResponse = require(\"@kth/http-responses\");\nconst app = express();\n\napp.get(\"/\", function (request, response) {\n  httpResponse.ok(request, response, \"\u003c!DOCTYPE html\u003e\u003ch1\u003eHello world!\u003ch1\u003e\");\n});\n\napp.get(\"/_monitor\", function (request, response) {\n  httpResponse.ok(\n    request,\n    response,\n    \"APPLICATION_STATUS: OK\",\n    httpResponse.contentTypes.PLAIN_TEXT\n  );\n});\n\napp.get(\"/error5xx.html\", function (request, response) {\n  httpResponse.internalServerError(request, response, \"Internal Server Error\");\n});\n\napp.get(\"/favicon.ico\", function (request, response) {\n  httpResponse.noContent(request, response);\n});\n\napp.use(function (request, response) {\n  httpResponse.notFound(request, response, \"Page not found\");\n});\n\napp.listen(80, function () {\n  console.log(\"Server started\");\n});\n```\n\n```json\n{\n  \"name\": \"Demo\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Demo app for @kth/http-responses\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"clean\": \"rm -r ./node_modules \u0026\u0026 rm package-lock.json\"\n  },\n  \"author\": \"paddy@kth.se\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"@kth/http-responses\": \"^1.0.20\",\n    \"express\": \"^4.17.1\"\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fhttp-responses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkth%2Fhttp-responses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fhttp-responses/lists"}