Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
koa-json-mock-server
Advanced tools
[![npm version](https://badge.fury.io/js/koa-json-mock-server.svg)](https://badge.fury.io/js/koa-json-mock-server) ![npm](https://img.shields.io/npm/dy/koa-json-mock-server)
Readme
Example of: https://www.npmjs.com/package/koa-json-mock-server
npm install
##Run
npm start
#Data
###db/user.json
[
{ "id" : 1,
"name" : "User 1",
"favourites" : [
{ "title" : "Favorito 1",
"url" : "url1"
},
{ "title" : "Favorito 2",
"url" : "url2"
}, {
"title" : "Favorito 3",
"url" : "url3"
}, {
"title" : "Favorito 4",
"url" : "url4"
}, {
"title" : "Favorito 5",
"url" : "url5"
}
]
}
]
###db/bets.json
[
{
"id": 1,
"date": "19/05/2015",
"reference": "39594382",
"description": "Single RUP 25.00",
"min": "Doble Chance - 90 Mins: Atletico Madrid / Draw @1.50",
"equipment": "Atletico Madrid - Real Madrid",
"player": "",
"match": "",
"result": "Won",
"comment": "25.00",
"in": "37.50",
"userId": 1
}
]
##To use
//server.js
var koa = require('koa');
var Router = require('koa-router');
var jsonServer = require('koa-json-mock-server');
var jsonBody = require('koa-json-body');
const app = new koa()
var koaRouter = new Router();
app.use(jsonBody());
app.use(jsonServer(__dirname + '/db'));
koaRouter.get('/hello', function *(next) {
this.body = 'Hello World!';
});
app.use(koaRouter.routes());
app.listen(3000);
###Url to test
####GET
####POST
Post method save only in memory
FAQs
[![npm version](https://badge.fury.io/js/koa-json-mock-server.svg)](https://badge.fury.io/js/koa-json-mock-server) ![npm](https://img.shields.io/npm/dy/koa-json-mock-server)
The npm package koa-json-mock-server receives a total of 52 weekly downloads. As such, koa-json-mock-server popularity was classified as not popular.
We found that koa-json-mock-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.