{"id":21659269,"url":"https://github.com/alwx/react-native-http-bridge","last_synced_at":"2025-07-17T22:31:43.337Z","repository":{"id":41086411,"uuid":"81090665","full_name":"alwx/react-native-http-bridge","owner":"alwx","description":"HTTP server for React Native","archived":false,"fork":false,"pushed_at":"2022-07-04T10:08:54.000Z","size":116,"stargazers_count":127,"open_issues_count":20,"forks_count":77,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-09T14:59:51.922Z","etag":null,"topics":["android","http-server","javascript","nodejs","react-native"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/alwx.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-02-06T13:38:01.000Z","updated_at":"2025-03-04T20:29:05.000Z","dependencies_parsed_at":"2022-09-13T02:32:06.600Z","dependency_job_id":null,"html_url":"https://github.com/alwx/react-native-http-bridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alwx/react-native-http-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwx%2Freact-native-http-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwx%2Freact-native-http-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwx%2Freact-native-http-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwx%2Freact-native-http-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alwx","download_url":"https://codeload.github.com/alwx/react-native-http-bridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwx%2Freact-native-http-bridge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265672334,"owners_count":23808842,"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":["android","http-server","javascript","nodejs","react-native"],"created_at":"2024-11-25T09:30:45.838Z","updated_at":"2025-07-17T22:31:43.041Z","avatar_url":"https://github.com/alwx.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"# react-native-http-bridge\n\nSimple HTTP server for [React Native](https://github.com/facebook/react-native).\nCreated for [Status.im](https://github.com/status-im/status-react). \n\nSince 0.5.0 supports and handles GET, POST, PUT and DELETE requests.\nThe library can be useful for handling requests with `application/json` content type\n(and this is the only content type we support at the current stage) and returning different responses.\n\nSince 0.6.0 can handle millions of requests at the same time and also includes some very basic support for [React Native QT](https://github.com/status-im/react-native-desktop). \n\n## Install\n\n```shell\nnpm install --save react-native-http-bridge\n```\n\n## Automatically link\n\n#### With React Native 0.27+\n\n```shell\nreact-native link react-native-http-bridge\n```\n\n## Example\n\nFirst import/require react-native-http-server:\n\n```js\n\n    var httpBridge = require('react-native-http-bridge');\n\n```\n\n\nInitalize the server in the `componentWillMount` lifecycle method. You need to provide a `port` and a callback.\n\n```js\n\n    componentWillMount() {\n      // initalize the server (now accessible via localhost:1234)\n      httpBridge.start(5561, 'http_service' request =\u003e {\n\n          // you can use request.url, request.type and request.postData here\n          if (request.type === \"GET\" \u0026\u0026 request.url.split(\"/\")[1] === \"users\") {\n            httpBridge.respond(request.requestId, 200, \"application/json\", \"{\\\"message\\\": \\\"OK\\\"}\");\n          } else {\n            httpBridge.respond(request.requestId, 400, \"application/json\", \"{\\\"message\\\": \\\"Bad Request\\\"}\");\n          }\n\n      });\n    }\n\n```\n\nFinally, ensure that you disable the server when your component is being unmounted.\n\n```js\n\n  componentWillUnmount() {\n    httpBridge.stop();\n  }\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwx%2Freact-native-http-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falwx%2Freact-native-http-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwx%2Freact-native-http-bridge/lists"}