mirror of
https://github.com/zhigang1992/interfake.git
synced 2026-01-13 09:10:31 +08:00
14 lines
334 B
JavaScript
14 lines
334 B
JavaScript
start
|
|
= endpoint +
|
|
|
|
endpoint
|
|
= m:method " " p:path " " s:status c:(" creates " e:endpoint + { return e; }) ? { return { method: m, path: p, status: s, creates: c } }
|
|
|
|
method
|
|
= $ "get" / "put" / "post" / "del"
|
|
|
|
path
|
|
= path:([/a-z] +) { return path.join(''); }
|
|
|
|
status
|
|
= status:[0-9]+ { return parseInt(status.join(""), 10); } |