- Development:
http://localhost:5001 - Production:
https://lefv.io
Currently, the API does not require authentication for public endpoints. Session-based authentication is available for future admin endpoints.
Different endpoints have different rate limits:
- General endpoints: 100 requests per minute
- Moderate endpoints: 30 requests per minute
- Strict endpoints (weather): 10 requests per minute
Rate limit headers are included in responses:
X-RateLimit-Limit: Maximum requests allowedX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Time when the limit resets
Check the health status of the application and its dependencies.
Response:
{
"status": "healthy",
"timestamp": "2024-01-01T12:00:00Z",
"database": {
"connected": true,
"errors": []
}
}Retrieve all blog posts.
Query Parameters:
tag(optional): Filter posts by tag
Response:
[
{
"id": "1",
"slug": "my-first-post",
"title": "My First Post",
"description": "Post description",
"content": "Full markdown content",
"date": "2024-01-01",
"readingTime": 5,
"tags": ["technology", "web"],
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
}
]Retrieve a single blog post by slug.
Response:
{
"id": "1",
"slug": "my-first-post",
"title": "My First Post",
"description": "Post description",
"content": "Full markdown content",
"date": "2024-01-01",
"readingTime": 5,
"tags": ["technology", "web"],
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
}Retrieve all available tags with post counts.
Response:
[
{
"id": "1",
"name": "technology",
"slug": "technology",
"postCount": 5
},
{
"id": "2",
"name": "web",
"slug": "web",
"postCount": 3
}
]Get current weather data. Falls back to OpenWeatherMap if Ambient Weather station is unavailable.
Response:
{
"temperature": 72.5,
"humidity": 65,
"windSpeed": 5.2,
"pressure": 29.92,
"windDir": 180,
"hourlyrainin": 0.05,
"dailyrainin": 0.15,
"weeklyrainin": 1.2,
"monthlyrainin": 3.5,
"feelsLike": 71.0,
"dewPoint": 58.0,
"lastRain": "2024-01-01T10:00:00Z",
"description": "partly cloudy",
"city": "Paris",
"country": "FR",
"source": "openweather"
}Source Values:
ambient: Data from Ambient Weather stationopenweather: Data from OpenWeatherMap API
Get historical weather data (only available with Ambient Weather station).
Parameters:
type: Eithertemperatureorprecipitation
Response for temperature:
[
{
"time": "2024-01-01T12:00:00Z",
"value": 72.5
}
]Response for precipitation:
[
{
"time": "2024-01-01T12:00:00Z",
"hourly": 0.05,
"daily": 0.15
}
]Retrieve gallery images.
Response:
[
{
"id": "1",
"imageUrl": "https://example.com/image.jpg",
"title": "Image Title",
"description": "Image description",
"category": "photography",
"order": 1,
"createdAt": "2024-01-01T12:00:00Z"
}
]All endpoints follow a consistent error response format:
{
"error": "Error message",
"message": "Detailed error description",
"statusCode": 400
}200 OK: Request successful400 Bad Request: Invalid request parameters404 Not Found: Resource not found429 Too Many Requests: Rate limit exceeded500 Internal Server Error: Server error503 Service Unavailable: Service temporarily unavailable
CORS is enabled for production domains specified in the ALLOWED_ORIGINS environment variable. In development, all origins are allowed.
WebSocket connections are supported at the same base URL for real-time features (future implementation).
The API currently does not use versioning. Breaking changes will be communicated in advance and a migration period will be provided.
See .env.example for all available configuration options including:
- Database connections
- Weather API keys
- Session secrets
- CORS origins
- Logging levels