Helps client-side Web development by mocking JSON API server.
Installation
hunk can be installed via pip or easy_install:
$ pip install hunk
Or:
$ easy_install hunk
Usage
Setup data directory and files.
Directories under the root have a HTTP method name
Directories and files have name to be resource path
Files have conent to be response JSON
For example:
$ tree demo/simple/
demo/simple/
|-- get
| |-- members
| | |-- 100.json
| | |-- 200.json
| | |-- 300.json
| | ...
| +-- sounds.json
|-- post
| +-- members.json
...
Move to the root directory and run hunk:
$ cd demo/simple/
$ hunk
* Running on http://localhost:8080/
Now, you can access Web API with HTTP:
$ curl http://localhost:8080/members/100
{"gender": "female", "kind": "human", "name": "Dorothy"}
$ curl http://localhost:8080/members
[{"kind": "scarecrow", "name": "Hunk"}, ...]
$ curl http://localhost:8080/sounds
[{"title": "Over The Rainbow"}, ... ]
$ curl http://localhost:8080/members -X POST
{"result": "success"}
Release files for hunk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | |
|---|---|---|---|
| hunk-0.1.0.zip | 18.3 kB | Details | |
| hunk-0.1.0.tar.gz | 8.6 kB | Details |
Release files / hunk-0.1.0.zip
| Download URL | hunk-0.1.0.zip |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
701f384da556502b213d808dae93fa5ab9eb8cfdb64335c29aa0d5f1a288053e
|
|
BLAKE2b-256 checksum How to use checksums |
f41777b48274c17ee0202cebd1dda4578dc11319e5ac8ad90c57be32f5bf0d36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / hunk-0.1.0.tar.gz
| Download URL | hunk-0.1.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d098e0a6ce2bad0bcb5c23bcc70bb5d8d10e8c401434dba3354be80dbfa7d5ab
|
|
BLAKE2b-256 checksum How to use checksums |
b103ae015d480d14e548231736151355d000640be18e5b05927eaa1daae13ae7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |