DEV Community

nabbisen
nabbisen

Posted on Edited on

apimock-rs (former json-responder) 1.1: dynamic path resolution

I released json-responder 1.1.0.

GitHub logo apimokka / apimock-rs

HTTP(S) mock server. Drop JSON files into a folder and your API immediately exists.

apimock-rs (API Mock)

npm crates.io License
Rust Documentation Dependency Status Releases Workflow App Docs Workflow

logo

Build a working REST API in seconds โ€” without a backend.
Frontend blocked by an unfinished backend Need stable API responses for UI tests or offline development ?
Drop JSON files into a folder and your API immediately exists.

Mock APIs easily ๐ŸŽˆ โ€” just JSON and go

If youโ€™re building or testing APIs, this tool makes mocking painless. Itโ€™s super fast, efficient, and flexible when you need it to be. All you have to do to start up is just use folders and JSON without any config set.

  • โ„๏ธ Zero-config start.
  • ๐ŸŒฌ๏ธ Fast to boot, light on memory.
  • ๐Ÿช„ File-based and rule-based matching. Scripting supported.

apimock-rs handles real project scale

As your project grows, your mock API grows, too. Large mock datasets often cause problems:

  • Slow startup
  • High memory usage
  • Crashes during UI testing
  • Unstable CI runs

When to use ?

  • The backend is notโ€ฆ

This release contains new feature to resolve path dynamically when dyn_data_dir is activated.

It means the server automatically returns .json / .json5 responses under dyn_data_dir.

Supposed that there is:

json-responder-data (as `dyn_data_dir`)
โ”œโ”€โ”€ a
โ”‚   โ””โ”€โ”€ b
โ”‚       โ””โ”€โ”€ c.json5
โ””โ”€โ”€ a.json
Enter fullscreen mode Exit fullscreen mode

the responses at requests are:

request path response content
/a a.json
/a/b (HTTP 404)
/a/b/c c.json5

Now you don't have to write in config all paths you want to use in API tests โ˜บ

Top comments (1)

Collapse
 
nabbisen profile image
nabbisen •

Renamed to apimock-rs. Now more than returning JSON data.

github.com/nabbisen/apimock-rs