API Overview

This API exposes the weekly menu for Food Court 2. It is designed to be simple to consume from web, mobile, or server apps.

For full details and examples, see the API Documentation.

Quickstart

Fetch current menu (public)

curl -s https://your-domain.vercel.app/api/menu | jq

JavaScript (browser/node)

const res = await fetch('https://your-domain.vercel.app/api/menu');
const data = await res.json();
console.log(data.week, Object.keys(data.menu));

Upload new menu (admin only)

# Login via the web UI at /admin, then reuse the browser session cookie
curl -X POST https://your-domain.vercel.app/api/upload   -F "file=@menu.xlsx"   -H "Cookie: next-auth.session-token=YOUR_SESSION_TOKEN"
Endpoints
GET /api/menu

Return the current processed weekly menu (public). Supports querying by week label, start date, or specific date.

GET /api/history

Access historical menu data from previous weeks. Returns all available weeks or specific week data. Requires authentication.

POST /api/upload

Upload and process an Excel file (.xlsx/.xls). Requires admin session.