restfor
v0.9.25
Published
## Create Restfor router for your express app
Downloads
35
Maintainers
Readme
Restfor
Create Restfor router for your express app
import createRouter from 'restfor/createRouter'
...
const router = await createRouter({
db: { host: '', database: '', username: '', password: '' },
modelsPath: '...',
routesPath: '...'
})
app.use('/api', router)
Create Restfor component for your React app
import createApp from 'restfor/createApp'
ReactDOM.render(
createApp({ apiUrl: '.../api' }, register => {} ),
document.getElementById('root')
)
The second argument (viewFactory
) is optional.