@json-server/core
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@json-server/core

Setup a fully working REST JSON server in seconds

Getting started

Install JSON Server module:

npm install @json-server/core

Setup your express application:

import {createServer} from "@json-server/core"
const server = createServer("db.json", {
  // server options
})

server.listen(3000, () => {
  console.log('JSON Server is running')
})

Start the application:

$ node app.js

You can also start a In Memory database passing a JSON object instead of a local JSON file:

const server = createServer({
  posts: [{
    id: 1,
    body: "foo"
  }],
  comments:[{
    id: 1,
    body: "bar",
    postId: 1
  }]
})

License

MIT License © Filippo Conti

Package Sidebar

Install

npm i @json-server/core

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

543 kB

Total Files

51

Last publish

Collaborators

  • b4dnewz