Skip to content

dwjohnston/api-mock-generator

Repository files navigation

api-mock-generator

This is an attempt at creating a mock server based on observing real world application usage.

See this post for motivation: https://blacksheepcode.com/posts/the_tool_i_want_to_exist

Current status

The end-to-end tooling is not currently working.

Best thing to be doing is running the tests.

Populate the .env file at application/.env (You need an OpenAPI key)

cd application
bun install
bun test

Recording HAR files

  1. Start mitmproxy running
mitmproxy
  1. Start the sample-api
bun run start:sample-api
  1. Start the proxy running
bun run start:proxy-server
  1. Make your requests against http://localhost:3001

  2. In mitm proxy, run the command

har.save @all proxyRecords/har.json

6 You can preserve your recording with

bun run copy-har "scenario-name"

About

Experimenting with AI powered API mock generation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published