Middag is a weekly dinner planner that helps you organize meals for the week. The application fetches meal ideas from an Excel file and generates a weekly meal plan based on your preferences.
Key features:
- Fetch meal data from an Excel file with category organization
- Filter meals by categories (fish, vegetarian, red meat, etc.)
- Generate weekly meal plans using random or weighted algorithms
- Lock specific days to preserve certain meals
- Drag-and-drop reordering of meals
- Manual editing (double-click any meal to change it)
- Copy the plan to clipboard for sharing
- Multi-language support (Norwegian, English, Spanish)
This guide describes how to deploy the application.
The application consists of two components:
index.html- A standalone web application (no build process required)cors-proxy-worker.js- A Cloudflare Worker that fetches your Excel file and adds CORS headers
The Worker serves two purposes:
- Allows the application to fetch Excel files from any URL without CORS restrictions
- Keeps your recipe file URL private (stored as a secret in Cloudflare)
- A Cloudflare account (free tier is sufficient)
- An Excel file (.xlsx) with your recipes, hosted somewhere publicly accessible
- Git and npm installed locally
-
Login to Cloudflare:
npx wrangler login
-
Deploy the worker:
npx wrangler deploy cors-proxy-worker.js --config wrangler-proxy.toml
-
Note the Worker URL (it will show something like):
https://middag-proxy.YOUR_SUBDOMAIN.workers.dev -
Set your secret recipe URL:
npx wrangler secret put DEFAULT_RECIPE_URL --config wrangler-proxy.toml
When prompted, paste your Excel file URL (e.g.,
https://example.com/your-recipes.xlsx)
-
Open
index.htmland find line ~529:const proxyUrl = 'https://middag-proxy.YOUR_SUBDOMAIN.workers.dev/';
-
Replace
YOUR_SUBDOMAINwith your actual Cloudflare worker subdomain
Choose one of these methods:
git add index.html cors-proxy-worker.js wrangler-proxy.toml
git commit -m "Add simple single-file version with CORS proxy"
git pushThen in GitHub:
- Go to Settings → Pages
- Source: Deploy from branch → main
- Your site will be at:
https://YOUR_USERNAME.github.io/middag/
- Go to Cloudflare Dashboard → Pages
- Create new project
- Connect your GitHub repo or upload
index.htmldirectly - Deploy the project
Upload index.html to any web server.
- Open your deployed site
- Click "Load Meals" without entering a URL
- The application should load your default (hidden) recipes
- Users can still provide their own Excel URL if they want
User clicks "Load Meals"
↓
(no URL entered)
↓
HTML calls → Worker (with no URL param)
↓
Worker uses → SECRET DEFAULT_RECIPE_URL
↓
Worker fetches Excel → Adds CORS headers
↓
Returns to HTML → Displays meals
Your recipe URL is never exposed in the HTML source code.
npx wrangler secret put DEFAULT_RECIPE_URL --config wrangler-proxy.tomlPaste the new URL when prompted.
- Worker: Free tier includes 100,000 requests per day
- Bandwidth: Free on Cloudflare's free tier
- Total: No cost for typical usage