How klasikh/node_api_mysql works
This repository is a small Express service for CRUD operations on notes. A client request enters the app, is routed to a notes handler, and the handler reads or mutates notes through a MySQL pool before returning a response. The app also installs not-found and error middleware; handlers are wrapped to forward exceptions, and custom errors carry HTTP status codes. The README gives no additional product capabilities, and the graph is based on the shown source excerpts.
Main entry points: app.js Express App · notes.controllers.js Notes CRUD · customErrors.js Custom Errors · notes.routes.js Notes Routes
Components 10
HTTP API
- Express App
app.js - Notes Routes
src/resources/notes/notes.routes.js - Notes CRUD
src/resources/notes/notes.controllers.js
Notes Storage
- MySQL Pool
src/db/connect.js - MySQL Database
Error Handling
- Async Wrapper
src/middlewares/tryCatchWrapper.js - Custom Errors
src/errors/customErrors.js - Not Found
src/middlewares/notFound.js - Error Handler
src/middlewares/handleError.js
Other components
- API Client
Connections 11
- API Client → Express App: sends requests
app.js - Express App → Notes Routes: mounts at /notes
app.js - Notes Routes → Notes CRUD: dispatches handlers
src/resources/notes/notes.routes.js - Notes CRUD → MySQL Pool: queries notes
src/resources/notes/notes.controllers.js - MySQL Pool → MySQL Database: configures connection
src/db/connect.js - Notes CRUD → Async Wrapper: wraps handlers
src/resources/notes/notes.controllers.js - Async Wrapper → Custom Errors: creates errors
src/middlewares/tryCatchWrapper.js - Notes CRUD → Custom Errors: creates errors
src/resources/notes/notes.controllers.js - Error Handler → Custom Errors: checks error type
src/middlewares/handleError.js - Express App → Not Found: registers fallback
app.js - Express App → Error Handler: registers handler
app.js