1.0.0 • Published 12 months ago

jasonn-server v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

JASONN Server

This is a simple fake REST API customized based on JSON Server.

Created with <3 for newbie front-end developers who need a simple API to use for testing or learning only.

Table of contents

Getting started

Install JSON Server

npm install jasonn-server     # NPM
yarn add jasonn-server        # Yarn

Create a db.json file with some data

{
  "posts": [{ "id": 1, "title": "json-server", "author": "typicode" }],
  "comments": [{ "id": 1, "body": "some comment", "postId": 1 }],
  "profile": { "name": "typicode" }
}

Start JASONN Server

npx jasonn-server db.json

Now if you go to http://localhost:8080/posts/1, you'll get

{ "id": 1, "title": "json-server", "author": "typicode" }

Database

GET /api/db

Homepage

GET /

Extras

Alternative port

You can start JASONN Server on other ports with the --port flag:

$ jasonn-server db.json --port 3004

Tip use modules like Faker, Casual, Chance or JSON Schema Faker.