UNPKG

redux-security

Version:
24 lines (21 loc) 618 B
import { manager } from 'redux-manager' import { SERVICE } from '../config' export const configAPIExpressServer = ( { app, serviceName = SERVICE } = { serviceName: SERVICE } ) => { const api = () => { const API = manager.api.get(serviceName) if (!API) { const ERROR = `manager.api.get('${serviceName}') == undefined` error(ERROR, `${tags}.configSaga.api`) throw new Error(ERROR) } return API } app.use('/api/auth/codeConfirm/:code', (request, result, next) => { const { code } = request.params api().codeConfirm({ code }) next() }) }