0.0.6 • Published 4 years ago
alto-json-server v0.0.6
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