New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-http-server-x

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

react-native-http-server-x

Http Server

unpublished
latest
Source
npmnpm
Version
0.2.8
Version published
Maintainers
1
Created
Source

react-native-http-server-x

Getting started

$ npm install react-native-http-server-x --save

Manual installation

iOS

$ cd ios & pod install

Usage

import { Router, HttpServer } from 'react-native-http-server-x';

const router = new Router('/').get(request => {
  console.log("id", request.id);
  console.log("method", request.method);
  console.log("path", request.path);
  console.log("query", request.query);
  console.log("headers", request.headers);
  console.log("data", request.data);

  return { 
    status: 200, 
    data: JSON.stringify({message: "Hello"}),
    contentType: "application/json"
  };
})

const httpServer = new HttpServer(9100);
httpServer.registerRouter(router);

httpServer.start().then((url) => {
  console.log(`Server running on ${url}`)
  setUrl("http://127.0.0.1:9100?arg=1");
}).catch((err) => {
  console.error(err)
});

Result

LOG  Running "main" with {"rootTag":1,"initialProps":{}}
LOG  Server running on http://192.168.1.250:9100/
LOG  id FE929FBA-A86D-4511-86C9-70516246FC4B
LOG  method GET
LOG  path /
LOG  query {"arg": "1"}
LOG  headers {"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Encoding": "gzip, deflate", "Accept-Language": "es-US,es-419;q=0.9,es;q=0.8", "Connection": "keep-alive", "Host": "127.0.0.1:9100", "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"}
LOG  contentType -1
LOG  contentLength 
LOG  data 

Keywords

react-native

FAQs

Package last updated on 07 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts