${prompt}
We create amazing digital experiences
Fast & Efficient
Lightning-fast performance and optimized workflows
Quality Assured
Every project meets our highest standards
24/7 Support
Round-the-clock assistance when you need it
const express = require('express'); const path = require('path'); const cors = require('cors'); const app = express(); const PORT = process.env.PORT || 3000; // Simple in-memory rate limit per IP (token bucket) const buckets = new Map(); function rateLimit(req, res, next) { const ip = req.ip || req.connection.remoteAddress || 'unknown'; const now = Date.now(); const cap = 100; // tokens const refill = 50; // tokens per minute const b = buckets.get(ip) || { tokens: cap, last: now }; const elapsed = (now - b.last) / 1000 / 60; // minutes b.tokens = Math.min(cap, b.tokens + elapsed * refill); b.last = now; if (b.tokens < 1) { return res.status(429).json({ error: 'Too many requests. Please slow down.' }); } b.tokens -= 1; buckets.set(ip, b); next(); } // Middleware app.use(cors()); app.use(express.json({ limit: '2mb' })); // Health check app.get('/api/health', (req, res) => { res.json({ ok: true, time: Date.now(), service: 'VibeCode Local AI', version: '2.0.0' }); }); // Template generation endpoint app.post('/api/generate', rateLimit, async (req, res) => { try { const { prompt, template, style } = req.body || {}; if (!prompt || !template) { return res.status(400).json({ error: 'Missing required parameters: prompt, template' }); } // Template configurations const templates = { vibecode: { name: "VibeCode App", description: "Modern web app with vibecoding aesthetics", structure: { html: `
Modern vibes, clean code, smooth UX
Clean overview of your data
Real-time insights
Configure your vibe
We create amazing digital experiences
Lightning-fast performance and optimized workflows
Every project meets our highest standards
Round-the-clock assistance when you need it
Welcome back! Here's what's happening with your business.
1,234
+12%$12,345
+8.2%+23%
+4.1%856
-2.1%