happy-nueng/api_mock — reverse-engineered prompt
Reverse engineered prompt
Build me a small Go app that runs a local API mock server. I want to define fake endpoints and responses in a config file, then start the server and hit those endpoints from Postman or a frontend while the real backend is not ready.
Use the existing config.yaml and mock.txt idea if that is what this project is set up for, but keep it simple and easy to edit. It should support basic HTTP methods, paths, status codes, headers, and JSON or text response bodies. Add clear console logs when requests come in, and return helpful errors if the config is missing or invalid.
Please make it runnable with go run main.go and include a short example config plus brief usage notes in the repo so someone non technical can change the mock responses later. Look up current Go docs if needed.
Want more depth? Deep Reverse