const jsonServer = require('json-server')
const server = jsonServer.create()
const router = jsonServer.router('db.json')
const middlewares = jsonServer.defaults()
const port = process.env.PORT || 3000
server.use(middlewares)
server.use(router)
server.listen(port)
[
{
"id": 1,
"title": "json-server",
"author": "typicode"
}
]
ReferenceError: path is not defined
at showblogpage (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02controllerpagecontroller.js:12:30)
at Layer.handle [as handle_request] (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outerlayer.js:95:5)
at next (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outer
oute.js:144:13)
at Route.dispatch (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outer
oute.js:114:3)
at Layer.handle [as handle_request] (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outerlayer.js:95:5)
at P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outerindex.js:284:15
at Function.process_params (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outerindex.js:346:12)
at next (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outerindex.js:280:10)
at Function.handle (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outerindex.js:175:3)
at router (P:Hnad Holding Service ClassJavaScript MERN Stack DevelopmentExpress JSExpress Class 02
ode_modulesexpresslib
outerindex.js:47:12)