/locally-server

A JSON file RESTful API based on json-server for zce/weapp-locally & zce/quickapp-locally

Primary LanguageHTMLMIT LicenseMIT

locally-server

Build Status Dependency Status devDependency Status Code Style

A JSON file RESTful API with authorization based on json-server for zce/weapp-locally & zce/quickapp-locally

Usage

# clone repo
$ git clone https://github.com/zce/locally-server.git <my-api-server>

# change directory
$ cd <my-api-server>

# install dependencies
$ yarn # or npm install

modify database.json file

# serve with hot reload at http://localhost:3000
$ yarn dev

JSON Server Resources Endpoints

  • Slides: /slides/:id?
  • Categories: /categories/:id?
  • Shops: /shops/:id?

To access and modify resources, you can use any HTTP method: GET POST PUT PATCH DELETE OPTIONS

Backdoor Endpoints

GET /backdoor/delay

add a delay of 1000ms for each endpoint

$ curl http://localhost:3000/backdoor/delay

Related

License

MIT © 汪磊