haddock
v0.0.0
Published
Ha(ddo)ck your API
Downloads
3
Readme
Haddock
Configuration
response: String
Endpoint
Put all response in response
folder.
Usage
HTTP response should be placed in a specific folder. HTTP response is identified by :
- method
- path
- body
- query
A response is place in a file path
within method
folder.
query
and body
are use to match a HTTP request. Due to filesystem is not a good idea to use query for filepath or filename.
If no extension is provided, it will match HTTP request response type to match with local file mime type.
Path /
is match to index
filename. Default name is still overridable to avoid conflict. You could override default value to _index
or whatever you want.
Ex:
- GET /foo/bar
- GET /foo/bar/
- GET /foo/bar.json
- GET /foo/bar.xml
- GET /foo/bar?q=1&w=2
- GET /foo/bar?q=1&w=3
- HEAD /
- POST /foo/bar with body { "username": "alice" }
- POST /foo/bar with body { "username": "bob" }