adnanh/webhook ? reverse-engineered prompt

Reverse engineered prompt

Build me a lightweight webhook server in Go that lets me define HTTP endpoints and run shell commands when they get hit.

I want to be able to load hooks from a JSON or YAML config file, give each hook an id, point it at a command, and optionally set a working directory. When a request comes in, the server should read the headers, query params, and body, then pass useful values into the command as arguments or environment variables. It should also support simple trigger rules so I can protect hooks with things like secrets or other checks before anything runs.

Please include the basics too, like running on a default port, optional HTTPS with cert and key files, and a way to serve JSON or YAML configs as templates. If it helps, make it easy to run behind a reverse proxy or on a Unix socket. Use current docs online if you need to, and keep the implementation clean and minimal.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab