API Reference Overview
The Ever Works provides a comprehensive REST API built with Next.js API routes. This section documents all available endpoints, authentication methods, and usage examples.
Base URL
Development: http://localhost:3000/api
Production: https://yourdomain.com/api
Authentication
The API supports multiple authentication methods:
1. Session-based Authentication
Used for web application requests:
// Automatic for browser requests with valid session
fetch('/api/items', {
credentials: 'include'
})
2. API Key Authentication
For server-to-server requests:
fetch('/api/items', {
headers: {
'Authorization': 'Bearer your-api-key'
}
})