sg-luma-events
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v28View latest version
Option A: Deno (Recommended)
- Use
deno-server.ts+railway.toml - Modern TypeScript runtime
- No package management needed
Option B: Node.js
- Use
node-server.js+package.json - Traditional Node.js with Express
- Standard npm ecosystem
# Create a new repository with your chosen files mkdir luma-cors-proxy cd luma-cors-proxy # For Deno deployment: cp deno-server.ts ./server.ts cp railway.toml ./railway.toml # OR for Node.js deployment: cp node-server.js ./server.js cp package.json ./package.json # Add your README cp README.md ./README.md # Initialize git and push git init git add . git commit -m "Initial commit - Luma CORS Proxy for Railway" git remote add origin https://github.com/yourusername/luma-cors-proxy.git git push -u origin main
- Go to railway.app
- Sign up/Login (can use GitHub)
- Click "Deploy from GitHub repo"
- Select your repository
- Railway auto-detects your runtime and deploys!
In Railway dashboard:
- Go to your project
- Click "Variables" tab
- Add:
LUMA_API_KEY=secret-FMPoZlwNgVJ0qkCSn2EIHpTUA
After deployment, Railway gives you a URL like:
https://luma-cors-proxy-production.up.railway.app
# Test basic functionality curl https://your-app.up.railway.app # Test next3 filter curl "https://your-app.up.railway.app?next3=true" # Test with calendar ID curl "https://your-app.up.railway.app?calendar_id=cal-0pgAb0xbjL529WF&next3=true"
Replace your API calls with the new Railway URL:
// Use your new Railway proxy
fetch('https://your-app.up.railway.app')
.then(response => response.json())
.then(data => {
console.log('Luma events:', data);
// Use your event data here
});
Your proxy is now running on Railway with:
- β Same functionality as Val Town
- β Custom domain support
- β Auto-scaling
- β Environment variables
- β Git-based deployments
- β Free tier available
Deployment fails?
- Check Railway logs in dashboard
- Verify file names match the runtime choice
- Ensure all files are committed to git
Proxy not working?
- Test the health endpoint:
/health(Node.js version) - Check environment variables are set
- Compare response with your Val Town version
CORS issues?
- Verify the proxy is returning proper CORS headers
- Test with a simple curl command first
- Check browser network tab for error details
- Custom Domain: Add your own domain in Railway dashboard
- Monitoring: Set up Railway's built-in monitoring
- Scaling: Configure auto-scaling if needed
- Backup: Keep your Val Town version as backup during transition
Your client will love the Railway deployment! π―