Redux Boot module to use Express web server.
npm install redux-boot-express --save
import {
HTTP_REQUEST,
HTTP_BOOT,
HTTP_AFTER_BOOT
} from 'redux-boot-express'
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)