Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zce/locally-server
A JSON file RESTful API based on json-server for zce/weapp-locally & zce/quickapp-locally
https://github.com/zce/locally-server
json-api json-server now now-sh rest-api restful
Last synced: 4 days ago
JSON representation
A JSON file RESTful API based on json-server for zce/weapp-locally & zce/quickapp-locally
- Host: GitHub
- URL: https://github.com/zce/locally-server
- Owner: zce
- License: mit
- Created: 2017-09-05T13:09:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-01T22:00:51.000Z (12 months ago)
- Last Synced: 2024-10-12T08:50:27.975Z (about 1 month ago)
- Topics: json-api, json-server, now, now-sh, rest-api, restful
- Language: HTML
- Homepage: https://locally.now.sh
- Size: 578 KB
- Stars: 14
- Watchers: 3
- Forks: 10
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# locally-server
[![Build Status][travis-image]][travis-url]
[![Dependency Status][dependency-image]][dependency-url]
[![devDependency Status][devdependency-image]][devdependency-url]
[![Code Style][style-image]][style-url]> A JSON file RESTful API with authorization based on [json-server](https://github.com/typicode/json-server) for [zce/weapp-locally](https://github.com/zce/weapp-locally) & [zce/quickapp-locally](https://github.com/zce/quickapp-locally)
## Usage
```sh
# clone repo
$ git clone https://github.com/zce/locally-server.git# change directory
$ cd# install dependencies
$ yarn # or npm install
```modify [database.json](database.json) file
```sh
# 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
```sh
$ curl http://localhost:3000/backdoor/delay
```## Related
- [zce/dashboard-server](https://github.com/zce/dashboard-server) - A JSON file RESTful API with JWT authorization based on json-server for [zce/dashboard](https://github.com/zce/dashboard)
## License
[MIT](LICENSE) © [汪磊](https://zce.me)
[travis-image]: https://img.shields.io/travis/zce/locally-server.svg
[travis-url]: https://travis-ci.org/zce/locally-server
[dependency-image]: https://img.shields.io/david/zce/locally-server.svg
[dependency-url]: https://david-dm.org/zce/locally-server
[devdependency-image]: https://img.shields.io/david/dev/zce/locally-server.svg
[devdependency-url]: https://david-dm.org/zce/locally-server?type=dev
[style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
[style-url]: https://standardjs.com/