v2/examples/rest-api-simple/README.md
A super simple REST API built with Express.js that demonstrates basic CRUD operations.
npm install
# Production mode
npm start
# Development mode with auto-reload
npm run dev
The API will start on port 3000 by default, or use the PORT environment variable.
curl http://localhost:3000/api/items
curl http://localhost:3000/api/items/1
curl -X POST http://localhost:3000/api/items \
-H "Content-Type: application/json" \
-d '{"name": "New Item", "description": "This is a new item"}'
curl -X PUT http://localhost:3000/api/items/1 \
-H "Content-Type: application/json" \
-d '{"name": "Updated Item", "description": "This is an updated item"}'
curl -X DELETE http://localhost:3000/api/items/1
{
"id": 1,
"name": "Item 1",
"description": "This is the first item"
}
{
"error": "Item not found"
}