Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/miikorz/DailyNews/llms.txt

Use this file to discover all available pages before exploring further.

The DailyNews REST API is a JSON REST API built with Node.js, Express, and TypeScript, backed by a MongoDB database. It exposes six endpoints for managing news feed items — including live web scraping from El País and El Mundo on every list request. No authentication is required; all endpoints are public and accept and return application/json.

Base URL

http://localhost:3001
The port is configurable via the PORT environment variable. All endpoint paths are relative to this base URL.

Endpoints Summary

MethodPathDescription
GET/feedList all feeds (triggers live scraping)
GET/feed/:idRetrieve a single feed by MongoDB ObjectId
POST/feedCreate a new feed item
PUT/feed/:idUpdate an existing feed item by ObjectId
DELETE/feed/:idRemove a feed item by ObjectId
POST/feed/searchSearch feeds by title substring

Response Format

Every response — success or error — is wrapped in a consistent JSON envelope. Success responses carry the payload in data and set error to null:
{
  "data": { "...": "..." },
  "error": null
}
Error responses set data to null and populate error with a machine-readable code and a human-readable message:
{
  "data": null,
  "error": {
    "code": "NOT_FOUND",
    "message": "Feed not found"
  }
}
{
  "data": null,
  "error": {
    "code": "BAD_REQUEST",
    "message": "Bad request"
  }
}
{
  "data": null,
  "error": {
    "code": "INTERNAL_SERVER_ERROR",
    "message": "Unexpected error occurred"
  }
}

HTTP Status Codes

CodeConstantDescription
200REQUEST_SUCCESSFULThe request completed successfully
204DELETED_SUCCESSFULLYThe resource was deleted; no content body needed
400BAD_REQUESTThe request was malformed or missing required fields
404NOT_FOUNDThe requested feed item does not exist
500INTERNAL_SERVER_ERRORAn unexpected server-side error occurred

Error Codes

These are the values of the SERVER_STATUS enum used in the error.code field, together with their corresponding SERVER_MESSAGES strings.
error.codeerror.message
INTERNAL_SERVER_ERRORUnexpected error occurred
NOT_FOUNDFeed not found
BAD_REQUESTBad request
The DELETED message ("Feed deleted successfully") is returned in the data field on a successful DELETE, not in the error envelope.
There is currently no authentication on any endpoint. All six routes are fully public — no API keys, tokens, or session cookies are required.

Endpoint Pages

GET /feed

List all news feeds. Triggers live scraping of El País and El Mundo before returning the combined stored result set.

GET /feed/:id

Retrieve a single news feed item from MongoDB by its ObjectId.

POST /feed

Create a new news feed item. Requires title and link.

PUT /feed/:id

Partially update an existing news feed item by ObjectId.

DELETE /feed/:id

Remove a news feed item from MongoDB by ObjectId.

POST /feed/search

Case-insensitive title substring search across stored feed items.

Build docs developers (and LLMs) love