Files
bonpin-adrian-movie-api/package.json
T
adrianbonpin 6d00bb3cd1 Add movie collection API and frontend
Express app with an in-memory array as the store (no database) and three
endpoints:

- GET  /api/movies      -> the whole collection
- GET  /api/movies/:id  -> one movie, 404 when the id is unknown
- POST /api/movies      -> add a movie, id assigned by the server

zod schemas are the single source of truth for validation, so a missing
title, genre or year comes back as a 400 with one message per field.
index.html is served by the same app and drives all three endpoints with
fetch(), refreshing the list after a movie is added.
2026-09-21 14:51:55 +08:00

16 lines
354 B
JSON

{
"name": "bonpin-adrian-movie-api",
"version": "1.0.0",
"description": "A simple movie collection REST API (Node.js + Express) with a frontend.",
"type": "module",
"main": "server.js",
"scripts": {
"start": "node server.js",
"dev": "node --watch server.js"
},
"dependencies": {
"express": "^5.1.0",
"zod": "^4.6.5"
}
}