react-native-embedded-httpd
v1.0.0
Published
A Turbo Module for create an HTTP server.
Maintainers
Readme
react-native-embedded-httpd
A React Native wrapper for creating embedded http servers in a mobile app:
- Android: [email protected]
- iOS: TBC
It is specifically designed to match Hono's API.
Usage
import { serve } from "react-native-embedded-httpd";
const appLike = {
async fetch(request, env, ctx) {
return new Response("Hello World!");
},
port: 8080,
};
const server = serve(appLike);
// To gracefully stop the server...
await server.close();Building the example app
yarn installcd workspaces/example-app- Prebuild in New Architecture by running
yarn arch:new, or runyarn arch:oldto test in legacy environments. - Run
yarn androidto test in Android - Run
yarn iosto test in iOS
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
If you use this library at work, consider sponsoring for a first-class technical support.
