Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
index.js
const jsonServer = require('json-server')
const server = jsonServer.create()
const middlewares = jsonServer.defaults()
const port = process.env.PORT || 3000
server.use(jsonServer.bodyParser)
server.use(middlewares)
server.listen(port, () => {
console.log('JSON Server is running')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.