Skip to content

Commit

Permalink
server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
pwangy committed Mar 8, 2024
1 parent 993612e commit aceb4b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const jsonServer = require('json-server')
const server = jsonServer.create()
const router = jsonServer.router('db.json')
const middlewares = jsonServer.defaults()
const port = process.env.PORT || 4000

server.use(middlewares)
server.use(router)

server.listen(port)

0 comments on commit aceb4b7

Please sign in to comment.