Flux Capacitor - Bootstrapper
Bootstrapping utils for the Flux Capacitor. Setting up a flux capacitor HTTP service in a simple, yet customizable way by using feature middlewares.
Usage
This will set up a flux capacitor service with RESTful routes for reading data, dispatching events and pushing realtime updates using a websocket:
const authorize = const connectTo = const bootstrap createExpressApp createDispatcher createStore createWebSocket use } = const commands = const createCollections = const rootReducer =
Customize
const bootstrap use =
If you want to use an existing express app or want to use some custom app then just pass it to use.app()
instead of using createExpressApp()
:
const bodyParser = const express = const bootstrap use = const app =
Authorization
const authorize = const bootstrap createWebSocket use = // Must return authorize.allow() or authorize.deny(Error) or a promise. { if !requser return authorize if requser === 'John' return authorize else // Can also pass an error object to `authorize.deny()` return authorize } { return authorize}
Flux Capacitor
Find it here 👉 Flux Capacitor
License
Released under the terms of the MIT license.