UNPKG

fetch-plugin

Version:

fetch polyfill with TIMEOUT setting and other options, extend from whatwg-fetch

14 lines (11 loc) 350 B
// server.js const jsonServer = require('json-server') const path = require('path') const server = jsonServer.create() const router = jsonServer.router(path.join(__dirname, './data/db.json')) const middlewares = jsonServer.defaults() server.use(middlewares) server.use(router) server.listen(3000, () => { console.log('JSON Server is Ready') })