DEV Community

nabbisen
nabbisen

Posted on • Edited on

I pre-released my project "apimock-rs" (former json-responder) written in Rust

I pre-released my project "json-responder" ☺

GitHub logo nabbisen / apimock-rs

API mock Server generating HTTP/JSON responses written in Rust

apimock-rs

crates.io Documentation Dependency Status Releases Workflow License

Summary

HTTP server generating REST/JSON responses. Aims to be mocking helper to develop microservices and APIs. Written in Rust and based on hyper.

Run ./apimock or ./apimock -c apimock.toml to start the server. It is single small native binary. Multiple platforms are supported and no installation is required.

Screenshots

Server started to listen:

server starts

curl test result:

server responds

Features

1. Basic

  • GET / POST methods
  • Multiple paths
  • Multiple .json/.json5 files treated as JSON Response
  • based on hyper v1

2. Customization

  • Custom HTTP response codes: 3xx as redirects, and 4xx and 5xx as errors
  • Custom response headers which are reusable
  • Flexible responses with patterns and jsonpath queries. Even with the same API URL path, multiple responses can be returned. See url.paths_patterns
  • Can specify response time on all or each API path

3. Dynamic processing

It is server written in Rust to generate JSON responses, aiming to help dev to easily get dummy API responses due to several paths.

Designed in mind with: fast speed, low memory consumption, easy usage.

Server startup:

server startup

curl result:

curl result

Top comments (1)

Collapse
 
nabbisen profile image
nabbisen

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

github.com/nabbisen/apimock-rs