Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

create json server

# Install JSON Server Globally
npm install -g json-server

# #Install JSON Server Locally
npm install json-server

# Check JSON Server version
json-server --version

# Run JSON server
json-server --watch db.json

# Change the server PORT
json-server --watch db.json --port 4000
Comment

how to create a json server

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)
Comment

PREVIOUS NEXT
Code Example
Javascript :: js shallow copy 
Javascript :: how to create an object in javascript 
Javascript :: node is not recognized as internal command 
Javascript :: javascript getter 
Javascript :: vue slice words 
Javascript :: chinese icon in react native vector icons 
Javascript :: Century From Year 
Javascript :: Half or Right Triangle star pattern in JavaScript 
Javascript :: jQuery download video from URL 
Javascript :: lodash isequal 
Javascript :: version check 
Javascript :: custom search filter in angular 8 
Javascript :: Kendo grid Excel export with filter 
Javascript :: how to not use relative imports in react js 
Javascript :: how to define cardTitle background image in mdl in reactjs 
Javascript :: leafletjs openstreets example 
Javascript :: javascript event listener get id of clicked items 
Javascript :: Javascript function method with any number of arguments 
Javascript :: sort method js 
Javascript :: Write Number in Expanded Form 
Javascript :: slice() in js 
Javascript :: how to get ip address and port from url in javascript 
Javascript :: JavaScript Creating Symbol 
Javascript :: how to define width with [styles] in percentage in angular 
Javascript :: create own rules jquery 
Javascript :: angular property binding 
Javascript :: universal mobile number regex 
Javascript :: even.target in javascript 
Javascript :: prisma where not in array 
Javascript :: js regex find text inside single quotes 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =