How liavhv/demoprisma works
DemoPrisma is a small Express API for managing states and municipalities with Prisma and SQL Server. A client sends requests to the server, which mounts the two resource routers under /api; each router handles its own list, create, read, update, and delete operations and accesses Prisma directly. State creation also validates and normalizes the name. The README documents SQL Server as the database and /api/Estados as a sample endpoint. The schema’s details are not excerpted, so its structure is not mapped here.
Main entry points: index.js Express server · estados.route.js States API · municipios.route.js Municipalities API
Components 5
API server
- Express server
index.js
Resource routes
- States API
routes/Estados/estados.route.js - Municipalities API
routes/Municipios/municipios.route.js
Data access
- SQL Server
Other components
- API client
Connections 5
- API client → Express server: sends requests
README.md - Express server → States API: mounts at /api
index.js - Express server → Municipalities API: mounts at /api
index.js - States API → SQL Server: queries via Prisma
routes/Estados/estados.route.js - Municipalities API → SQL Server: queries via Prisma
routes/Municipios/municipios.route.js