PedroFnseca/rest-api-C — reverse-engineered prompt

Reverse engineered prompt

Build me a small REST API in C that feels lightweight and fast. I want it to expose a users resource backed by PostgreSQL, with routes to list all users, get one user by id, create a user, update a user, and delete a user. The users table should just have id, name, and email.

Please make it runnable locally in a simple way, ideally with Docker and also with a normal make or script based flow for Linux. Keep the code straightforward and low level, using a small HTTP server approach in C, and wire it up cleanly to the database. If there is already an nginx setup in the project, make sure it works too, but the main goal is the API itself.

I also want the project to be easy to configure with database credentials, easy to build, and easy to test with localhost on port 8080. Add or polish anything missing so someone can clone it, set the database details, run it, and try the endpoints right away. If you need to, look up the current docs online.

Want more depth? Deep Reverse