Skip to content

Instantly share code, notes, and snippets.

Created Jan 30, 2021
What would you like to do?
JSON Server configuration for the Dad Joke Dadabase
const jsonServer = require('json-server')
const server = jsonServer.create()
const router = jsonServer.router('db.json')
const middlewares = jsonServer.defaults()
server.listen(process.env.PORT || 3000, () => {
console.log(`🚀 JSON Server is running on port ${process.env.PORT || 3000}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment