Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including react-native-ot-shield with all npm packages installed. Try it out:

var reactNativeOtShield = require("react-native-ot-shield")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

react-native-ot-shield v1.0.6

shield your app

react-native-ot-shield

Simple Request Crash / Method manager

Installation

Use the yarn manager yarn to install react-native-ot-shield.

yarn add react-native-ot-shield

Configuration

You must create one configuration file

{
    "remote":"https://myremote.dev",
    "actions": [
        "isExampleToSimpleAction"
        {
            "name":"isExampleToComplexeAction",
            "actions": [
                "subAction",
                "anotherSubAction"
            ]
        }
    ]
}

shield.setup.json

Import


import Shield from 'react-native-ot-shield'

Prepare


Shield.load(require('myconfig.json'))

Usage

Simple action :


let result = await Shield.isExampleToSimpleAction({nameP:dataP}) // Return JSON
// This action send object {nameP:dataP, action: isExampleToSimpleAction} in post to request https://myremote.dev/isExampleToSimpleAction

Complexe action :


let result = await Shield.isExampleToComplexeAction.subAction({nameP:dataP}) // Return JSON
// This action send object {nameP:dataP, action: subAction} in post to request https://myremote.dev/isExampleToComplexeAction

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free