{"id":42165029,"url":"https://github.com/pedramcode/rhttp-node","last_synced_at":"2026-01-26T21:00:31.707Z","repository":{"id":65823852,"uuid":"600328470","full_name":"pedramcode/RHTTP-node","owner":"pedramcode","description":"RHTTP NodeJS interface","archived":false,"fork":false,"pushed_at":"2023-02-15T15:07:55.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-11T13:27:54.488Z","etag":null,"topics":[],"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/pedramcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2023-02-11T06:21:02.000Z","updated_at":"2023-02-13T19:58:03.000Z","dependencies_parsed_at":"2023-02-25T22:00:12.184Z","dependency_job_id":null,"html_url":"https://github.com/pedramcode/RHTTP-node","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"b190e586b2a1878caf581a4be4a6a11eb2d09b44"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pedramcode/RHTTP-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2FRHTTP-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2FRHTTP-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2FRHTTP-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2FRHTTP-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedramcode","download_url":"https://codeload.github.com/pedramcode/RHTTP-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2FRHTTP-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28788061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: 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":"2026-01-26T21:00:20.015Z","updated_at":"2026-01-26T21:00:31.698Z","avatar_url":"https://github.com/pedramcode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RHTTP-node\n\nRHTTP NodeJS interface\n\n## Usage\n\nFirst create RHTTP server and pass redis host and port to it\n\n```ts\nconst server = new RHTTPServer(\"127.0.0.1\", 6379);\n```\n\nThe `RHTTPServer` class have a function for every HTTP method. Each method function has two parameters:\n\n1. **Path**: It's the path of endpoint\n2. **Callback**: It's callback function to handling requests\n\n```ts\nserver.get('/', (req, res) =\u003e {\n  const response_data = {\n    msg: 'Hello User!',\n  };\n  return res.status(200).contentType('application/json').send(JSON.stringify(response_data));\n});\n```\n\nThe `Callback` parameter is a function with two parameters:\n\n* **request**: Contains HTTP request data such as body, query params, etc.\n* **response**: An instance of `Response` class that you can modify and send response to user using it.\n\n### Response methods:\n\n* **status**: Sets HTTP status code and status message\n  * `res.status(200)`\n* **contentType**: Sets HTTP content type\n  * `res.contentType(\"application/json\")`\n* **header**: Append HTTP header to response\n  * `res.header({\"X-Custom-Header\": \"Header Value\"})`\n* **send**: Finalizes response progress and make HTTP response string\n  * `res.status(200).contentType('application/json').send(JSON.stringify(response_data))`\n\n\u003e **Note** \n\u003e You need to return `send()` method result to callback function to continue progress.\n\nAt the end server needs to listen to Redis for receiving incoming requests:\n\n```ts\nserver.listen((err) =\u003e {\n  if (err) {\n    console.error(err);\n  } else {\n    console.info('Server is ready');\n  }\n});\n```\n\n## License\nThis project is licensed under the terms of the MIT License. See the [LICENSE](LICENSE.txt) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedramcode%2Frhttp-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedramcode%2Frhttp-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedramcode%2Frhttp-node/lists"}