redux-boot-express
v0.1.4
Published
Redux Boot module wich implments Express web server.
Downloads
15
Maintainers
Readme
Redux Boot Express
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)