0.0.6 • Published 4 years ago

alto-json-server v0.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

alto-json-server

it uses json file or object as database. Makes CRUD operations on fake database.

usage

db.json

{
    "authors": [
        {
            "id": 1,
            "name": "dostoyevsky"
        },
        {
            "id": 2,
            "name": "tolstoy"
        }
    ],
    "books": [
        {
            "id": 1,
            "name": "crime and punishment",
            "authorId": 1
        },
        {
            "id": 2,
            "name": "anna karanina",
            "authorId": 2
        }
    ]
}

index.js

const {server} = require("alto-json-server");

const port = 3333;

server.startServer(port);
server.connectDbFromExternal("./db.json");

install package

yarn install alto-json-server

run

node index.js

test

curl --header "Content-Type: application/json" http://localhost:3333/authors

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago