Coder Social home page Coder Social logo

remotedev-server's Introduction

RemoteDev Server

Bridge for communicating with an application remotely via Redux DevTools extension, Remote Redux DevTools or RemoteDev. Running your server is optional, you can use https://jere.gitee.io/remotedev-app/ instead.

Installation

npm install --save-dev @jerexyz/remotedev-server

Also there's a docker image you can use.

Usage

Add in your app's package.json:
"scripts": {
  "remotedev": "remotedev --hostname=localhost --port=8000"
}

So, you can start remotedev server by running npm run remotedev.

Import in your server.js script you use for starting a development server:
var remotedev = require('remotedev-server');
remotedev({ hostname: 'localhost', port: 8000 });

So, you can start remotedev server together with your dev server.

Install the package globally (not recommended) just run:
remotedev --hostname=localhost --port=8000

Connection settings

Set hostname and port to the values you want. hostname by default is localhost and port is 8000.

To use WSS, set protocol argument to https and provide key, cert and passphrase arguments.

Inject to React Native local server

Add in your React Native app's package.json:
"scripts": {
  "remotedev": "remotedev --hostname=localhost --port=8000 --injectserver=reactnative"
}

The injectserver value can be reactnative or macos (react-native-macos), it used reactnative by default.

Then, we can start React Native server and RemoteDev server with one command (npm start).

Revert the injection

Add in your React Native app's package.json:

"scripts": {
  "remotedev-revert": "remotedev --revert=reactnative"
}

Or just run $(npm bin)/remotedev --revert.

Connect from Android device or emulator

Note that if you're using injectserver argument explained above, this step is not necessary.

If you're running an Android 5.0+ device connected via USB or an Android emulator, use adb command line tool to setup port forwarding from the device to your computer:

adb reverse tcp:8000 tcp:8000

If you're still use Android 4.0, you should use 10.0.2.2 (Genymotion: 10.0.3.2) instead of localhost in remote-redux-devtools or remotedev.

Save reports and logs

You can store reports via redux-remotedev and get them replicated with Redux DevTools extension or Remote Redux DevTools. You can get action history right in the extension just by clicking the link from a report.

Remotedev server is database agnostic. By default everything is stored in the memory, but you can persist data by specifying one of the jsData adapters above for adapter argument. Also you can add an dbOptions argument for database configuration. If not provided the default options will be used (for some adapters, like sql, it's required). You have to install the required adapter's npm package.

Storage adapter dbOptions argument example (optional) install
Firebase firebase { basePath: 'https://my-app.firebase.io' } npm install --save js-data-firebase
HTTP http { basePath: 'https://my-rest-server/api' } npm install --save js-data-http
LevelUp levelup './db' (the levelup "db" object will be available at "adapter.db") npm install --save js-data-levelup
MongoDB mongodb { name: 'user', idAttribute: '_id', table: 'users' } npm install --save js-data-mongodb
MySQL sql { client: 'mysql', connection: { host: '123.45.67.890', user: 'ubuntu', password: 'welcome1234', database: 'db1' } npm install --save js-data-sql
Postgres sql { client: 'pg', connection: { host: '123.45.67.890', user: 'ubuntu', password: 'welcome1234', database: 'db1' } npm install --save js-data-sql
Redis redis See the configurable options for node_redis npm install --save js-data-redis
RethinkDB rethinkdb { host: '123.456.68.987', db: 'my_db' } npm install --save rethinkdbdash js-data-rethinkdb
SQLite3 sql { client: 'sqlite3', connection: { host: '123.45.67.890', user: 'ubuntu', password: 'welcome1234', database: 'db1' } npm install --save js-data-sql

Implement a custom adapter for JSData.

License

MIT

remotedev-server's People

Contributors

zalmoxisus avatar jhen0409 avatar jerexyz avatar brentvatne avatar cameronhunter avatar nevir avatar jozanza avatar patw0929 avatar romulof avatar npmcdn-to-unpkg-bot avatar skovhus avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.