Build a simple REST API for a chat application with your partner!
npm installComplete the TODOs in server.js to implement:
POST /users- Register a userPOST /messages- Send a messageGET /messages- Get all messages
npm startServer starts on http://localhost:3000
Option 1: Same Computer
- Open
test-api.htmlin multiple browser windows/tabs - Join as different users in each window
- Chat between windows to test your API!
Option 2: Remote Partners (using ngrok)
# One partner runs:
npx ngrok http 3000
# Share the ngrok URL with your partner
# Both open test-api.html and update the API URLOption 3: curl
curl -X POST http://localhost:3000/users \
-H "Content-Type: application/json" \
-d '{"name":"Alice"}'Have fun building your chat API! 🚀