The InfoJobs DevBoard backend is an Express server that reads its runtime settings from environment variables, falling back to sensible defaults defined inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mauroperez055/infoJobs/llms.txt
Use this file to discover all available pages before exploring further.
config.js. This keeps the codebase portable across development and production environments without requiring code changes.
Environment Variables
The following variables control the server’s runtime behaviour. Values in the Default column are used when the variable is not set.| Variable | Default | Description |
|---|---|---|
PORT | 1234 | HTTP port the Express server listens on |
MODEL_AI | mistral/devstral-small-2 | AI model identifier exported from CONFIG in config.js |
VITE_API_URL | — | Set in the frontend .env; should point to the running backend URL (e.g. http://localhost:1234) |
backend/config.js:
LIMIT_PAGINATION and LIMIT_OFFSET are the fallback values used by the JobModel when no limit or offset query parameter is supplied.
npm Scripts
Run the following commands from thebackend/ directory.
| Script | Command | Description |
|---|---|---|
dev | nodemon index.js | Starts the server and restarts on every file change — recommended during development |
start | node index.js | Starts the server without hot reload — suitable for production |
CORS
CORS middleware allows the React frontend — typically served by Vite on port5173 — to make cross-origin requests to the Express API on port 1234.
The codebase ships with a custom CORS middleware in middlewares/cors.js that restricts allowed origins to an explicit allow-list:
index.js entry point uses the open cors() helper (all origins) for convenience in development. Swap in corsMiddleware() when you need to lock down origins:
When deploying behind a reverse proxy such as Nginx or Cloudflare,
app.set('trust proxy', 1) is already configured in index.js. This ensures the rate limiter reads the real client IP from the X-Forwarded-For header rather than the proxy address.Rate Limiting
The/ai router applies express-rate-limit to prevent abuse of the Ollama-backed AI summary endpoint. The limiter is scoped exclusively to that router and does not affect the /jobs endpoints.
429 Too Many Requests and the message body above. The counter resets automatically after the 60-second window.
The rate limit counter is stored in memory. It resets whenever the server process restarts, so it does not persist across deployments.