Boot and Routing
Boot Sequence
Section titled “Boot Sequence”-
server.jscreates the HTTP server and starts listening on the configuredPORT. -
app.jsruns: loads env vars, connects to MongoDB, registers Express middleware (CORS, body parsing, etc.), and mounts all routes. -
On successful MongoDB connection, the cron scheduler initializes and starts polling RSS feeds on an hourly schedule.
Mounted Routes
Section titled “Mounted Routes”| Method | Path | Access | Purpose |
|---|---|---|---|
ALL | /api/v1/auth/* | Public | Login and register |
ALL | /api/v1/article/* | JWT + admin | Article CRUD, publish, and moderation |
ALL | /api/v1/sites/* | JWT + admin | Hosted site management |
ALL | /api/v1/tags/* | Mixed | Tag list (authenticated) and admin CRUD |
ALL | /api/v1/category/* | JWT + admin | Category management |
ALL | /api/v1/section/* | JWT + admin | Section management |
ALL | /api/v1/geo/* | JWT + admin | Geographic data management |
ALL | /api/v1/publisher/* | JWT + role checks | Publisher admin and self-service feed |
ALL | /api/v1/client/* | API key | Read-only content for child-site frontends |
POST | /api/v1/sign-s3 | Authenticated | Generate pre-signed S3 upload URLs |
ALL | /api/v1/contact/* | Public | Contact form submissions |
/api/v1/client is the boundary between backend management and downstream child-site consumption. Only read operations are available through this group.