0.0.1 • Published 8 years ago
merver v0.0.1
Merver
A simple sequence mock API Server. This is intended to make functional UI tests easier for SPA applications
Merver will serve API endpoints according to a YAML definition. What makes this different than other mock servers, is that you can have sequenced responses for your use cases. For example:
- POST /login fails with 403 (assumed bad credentials)
- POST /login succeeds the second time with 200 (assumed good credentials)
- GET /user/1 gives back a user with name = "Laura Johnson"
- PUT /user/1 gives back a user with name = "Laura Raghunath"
- GET /user/1 gives back a user with name = "Laura Raghunath"
Example YAML for above:
---
routes:
"/login":
POST:
responses:
- response:
message: Invalid Password
status: 403
- response:
id: 1
name: Laura Johnson
status: 200
"/user/1":
GET:
response:
name: Laura Johnson
PUT:
response:
name: Laura Raghunath
update:
"/user/1":
GET:
response:
name: Laura Raghunath
GET /_docs
This readme in in markdown
POST /_setup
{
"YAML":"YAML Definition"
}
POST /_setup/file
{
"path":"Absolute YAML File Path"
}
GET /_merver
{
"rawYAML": "Raw YAML Text",
"definition": {
// JSON definition
}
}
0.0.1
8 years ago