redux-boot-express

0.1.4 • Public • Published

Redux Boot Express

Build Status

Redux Boot module to use Express web server.

Install

npm install redux-boot-express --save

Actions constants

import {
  HTTP_REQUEST,
  HTTP_BOOT,
  HTTP_AFTER_BOOT
} from 'redux-boot-express'

Usage

import boot from 'redux-boot'
import webServerModule, {HTTP_REQUEST} from 'redux-boot-express'
 
const helloModule = {
  middleware({getState, dispatch}) {
    return next => action => {
      let nextResult = next(action)
 
      if (action.type === HTTP_REQUEST) {
        const {request, response} = action.payload
        response.send('Hello!')
      }
 
      return nextResult
    }
  }
}
 
const initialState = {
  variables: {
    port: 3020
  }
}
 
const modules = [
  webServerModule,
  helloModule
]
 
const app = boot(initialState, modules)

License

MIT

Package Sidebar

Install

npm i redux-boot-express

Weekly Downloads

0

Version

0.1.4

License

MIT

Last publish

Collaborators

  • choko-org