Express.js re-implementation of crossly.persistence.service (the .NET app): durable storage of
private cross-stitch patterns, mirroring its REST API, HATEOAS links, gzip transport and MongoDB
storage — but built on our standard service structure (controllers → managers → repository).
| Method | Route | Purpose |
|---|---|---|
| GET | / |
List HATEOAS links, one per stored pattern |
| GET | /:id |
The pattern data model, gzip-compressed (application/octet-stream); 404/400 otherwise |
| POST | / |
Create from a gzip body → 201 + Location + { link }; 400 if invalid |
| PUT | /:id |
Replace from a gzip body (matches id and name) → 200/404; 400 if invalid |
| PATCH | /:id/rename |
Rename via { newName } → 200/404 |
| DELETE | /:id |
Delete → 204/404 |
Plus GET /health.
MongoDB CrosslyDb / DataModels (same as the .NET service, so it shares data). Override the
connection with MONGO_URI (default mongodb://127.0.0.1:27017). Pattern data models are stored as
structured documents with generated ObjectId ids; a version gate (0.0.0.1) guards the schema.
npm run build— build contracts then the servicenpm start— build and run on port 5003npm test— unit + integration tests (no database required; integration uses an in-memory repository)npm run test:unit/npm run test:integration
Apache-2.0