Can I run Express server code?
Static.app doesn't run server-side code. It serves static files (HTML, CSS, JavaScript, images) from a CDN. Your Express API server needs a separate host like Render ($7/month), Railway (usage-based), or Fly.io (free tier available). The recommended setup is to host your frontend on Static.app and your Express API separately. Your frontend makes HTTP requests to the API's URL for any server-side functionality.
What if Express only serves static files?
If your Express app's only job is app.use(express.static('public')), you don't need Express or a server at all. Upload those static files directly to Static.app. They'll be served from a global CDN (faster than a single Express server), with automatic SSL (no manual setup), built-in analytics (no middleware), and form processing (no custom endpoints). You save the cost and complexity of maintaining a running server.
What if my entire app is Express with no separate frontend?
If Express serves both API routes and rendered HTML, you'll need to decide: host the rendered HTML on Static.app and move API logic to a separate backend, or keep everything on a traditional Node.js host.
How do API calls work?
Your frontend JavaScript makes HTTP requests (fetch or Axios) to your Express API's URL. During the build step, set the API URL as an environment variable so it gets compiled into your frontend code. In production, the browser loads HTML from Static.app's CDN and sends API requests to your Express server on Render, Railway, or wherever you host it. Make sure your Express server has CORS configured to accept requests from your Static.app domain.
Can I replace express.static()?
Completely. The express.static() middleware serves files from a directory on your Express server. Static.app does the same thing but from a global CDN, which means faster delivery worldwide, automatic caching, and no load on your server. Upload your public folder's contents to Static.app and remove the express.static() middleware from your Express app. Your server focuses on API logic while the CDN handles file delivery.
Can I replace Express form handling?
Yes, for contact forms and feedback forms. Instead of writing Express routes to process form submissions, add the static-form attribute to your HTML form. When a visitor submits the form, Static.app captures the data and stores it in your dashboard. You can also sync submissions to Airtable automatically. This eliminates the need for Express form processing, email-sending packages (nodemailer), and spam protection middleware.
How do I handle API keys?
Don't put API keys in your frontend code. If your Express app accesses third-party APIs with secret keys, keep that logic on a backend server. Only the frontend (HTML/CSS/JS) goes on Static.app.
What about WebSocket connections?
WebSockets require a running server process. Host your WebSocket server on Render, Railway, or Fly.io. Your frontend on Static.app connects to it via the WebSocket URL.
Is this approach faster than a single Express server?
Yes. Your frontend loads from a CDN (cached globally), which is faster than serving files from a single Express server. API calls still go to your backend, but the initial page load is faster.
Can I migrate gradually?
Yes. Start by hosting the frontend on Static.app while keeping Express running. Update the frontend API URLs to point to your Express server. Migrate features to static alternatives (forms, analytics) over time.
How to deploy Express app for free?
Split your architecture. For the Express API server, Render offers a free tier (with sleep timers on free plans) and Railway offers $5 of free usage per month. For the frontend that your Express app serves, upload it to Static.app (free trial available, then $5/monthnth). This separation actually improves reliability: if your Express server crashes, your frontend still loads from the CDN and can show a helpful error message instead of a blank page.