actionsdemos/calculator — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a simple Node.js demo app that works like a basic pocket calculator.

It should expose REST API endpoints that let someone do arithmetic with integers, like add, subtract, multiply, and divide. Keep it straightforward and easy to understand, with a small public page if useful so someone can try the calculator from a browser.

Please include automated tests using Mocha and Chai to prove the calculator works, including normal cases and a few obvious edge cases like invalid input or division by zero. Make sure npm install and npm test are enough to set it up and run the tests.

Also include whatever basic server setup is needed to run the app locally, and keep the code clean and simple since this is meant to be a demonstration project.

Want more depth? Deep Reverse