Jason Server
Get a full fake REST API
Table of contents
Getting started
Install Jason Server
pip3 install jason-server
Create a db.json file with some data
{
"articles": [
{ "id": 1, "title": "jason-server", "author": "1" },
{ "id": 2, "title": "jason-routes", "author": "1" }
],
"authors": [
{ "id": 1, "name": "bob"}
]
}
Start JSON Server
jason-server watch db.json
Now if you go to http://localhost:8080/articles, you'll get
{ "id": 1, "title": "jason-server", "author": "1" },
{ "id": 2, "title": "jason-routes", "author": "1" }
Routes
Singular Routes
GET /authors
Plural Routes
GET /authors
GET /authors/1
Filter
GET /articles?title=title&author=eminem
Pagination
Use _page and _limit to paginate data.
In the Link header you'll get first, prev, next and last links.
GET /articles?_page=2
GET /articles?_page=3&_limit=15
Sorting
Use _sort and _order (defaults order: asccendant)
GET /persons?_sort=age
GET /persons?_sort=name&_order=desc
Database
GET /db
Extras
Alternative Host
You can start JSON Server on other host with the --host flag:
$ json-server --host "0.0.0.0" watch db.json
Default: localhost
Alternative Port
You can start JSON Server on other ports with the --port flag:
$ json-server --port 8100 watch db.json
Default: 8080
CLI Usage
Usage: jason-server [OPTIONS] COMMAND [ARGS]...
Options:
-h, --host TEXT Host adress
-p, --port INTEGER Port
-q, --quiet
--version Show the version and exit.
--help Show this message and exit.
Commands:
watch Run your database as REST Api
Credits
License
The code is available under the MIT license.
Metadata
Release files for jason-server 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jason-server-0.8.1.tar.gz | 10.0 kB | Without provenance | Details for jason-server-0.8.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jason_server-0.8.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for jason_server-0.8.1-py2.py3-none-any.whl |
Total release size: 17.8 kB
Release files / jason-server-0.8.1.tar.gz
| Download URL | jason-server-0.8.1.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7c5604601e1867316618fab3980f7c7cb29ebb71c4e19a9a78ee9c31866f437
|
|
BLAKE2b-256 checksum How to use checksums |
0bb1560544eb5c43275c1b5375cbc5920d1aef2f003fafa608decae08f50e931
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4
|
Release files / jason_server-0.8.1-py2.py3-none-any.whl
| Download URL | jason_server-0.8.1-py2.py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
8f8219d4f5507af5a0d735eb2ffb94daac83b332cee111ffb215fc6036c0e821
|
|
BLAKE2b-256 checksum How to use checksums |
020e15d362fc142b08fb1a5874c74f0f83ed22bd521f0302dee3e48f29c5a0a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4
|
Security for jason-server 0.8.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.