Created
January 30, 2021 05:12
-
-
Save thawkin3/bb384c7c32d3299c4634a7519b8ec852 to your computer and use it in GitHub Desktop.
JSON Server configuration for the Dad Joke Dadabase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsonServer = require('json-server') | |
const server = jsonServer.create() | |
const router = jsonServer.router('db.json') | |
const middlewares = jsonServer.defaults() | |
server.use(middlewares) | |
server.use(router) | |
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