#stub #session #request #log #testing

bin+lib serverify

serverify is stub HTTP server for testing

1 unstable release

0.2.0 Nov 26, 2024

#502 in HTTP server

Download history 107/week @ 2024-11-22 28/week @ 2024-11-29 6/week @ 2024-12-06

141 downloads per month

Apache-2.0

47KB
1K SLoC

serverify

codecov

serverify is stub HTTP server for testing.

Features

You can define specification of endpoint by YAML and listen as HTTP server.

After listen, you can use serverify's REST API to...

  • create/delete session the unit of request logging
  • get request information log per session

Installation

Download executable from releases.

Usage

Usage: serverify [OPTIONS] <CONFIG_PATH>

Arguments:
  <CONFIG_PATH>  

Options:
      --port <PORT>  [default: 8080]
  -h, --help         Print help
$ serverify example.yaml

YAML Config

field type requied description
.paths map key is path of endpoint
.paths[] map key is HTTP method name such as get
.paths[].response map response infomation for stub endpoint
.paths[].status int status code of the response
.paths[].headers map headers of the response
.paths[].body string body of the response

E.g.

paths:
  /hello:
    get:
      response:
        status: 200
        headers:
          Content-Type: application/json
        body: '{"message": "hello"}'

License

Apache-2.0

Dependencies

~58MB
~1M SLoC