Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Get a full fake REST API
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" }
GET /authors
GET /authors
GET /authors/1
GET /articles?title=title&author=eminem
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
Use _sort
and _order
(defaults order: asccendant)
GET /persons?_sort=age
GET /persons?_sort=name&_order=desc
GET /db
You can start JSON Server on other host with the --host
flag:
$ json-server --host "0.0.0.0" watch db.json
Default: localhost
You can start JSON Server on other ports with the --port
flag:
$ json-server --port 8100 watch db.json
Default: 8080
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
The code is available under the MIT license.
FAQs
JSON as REST API
We found that jason-server demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.