RORK LABJP
TOOLING — Rork's developer repos keep moving: rork-xcode was updated on July 16, rork-device on July 15, and rork-plist on July 13OPUS46 — Claude Opus 4.6 is live in Rork, and Rork Max is built to assemble apps on top of Claude CodeSIM — A cloud iOS simulator runs in the browser, with one click to install on a device and two clicks to publish to the App StoreMAX — Rork Max emits pure Swift rather than React Native, reaching iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and even iMessageNATIVE — That opens up HealthKit, ARKit and LiDAR, NFC, Dynamic Island, Live Activities, 3D through Metal, and on-device inference with Core MLSEED — Rork raised a $15M seed led by Left Lane Capital, with Peak XV and a16z Speedrun joining the roundTOOLING — Rork's developer repos keep moving: rork-xcode was updated on July 16, rork-device on July 15, and rork-plist on July 13OPUS46 — Claude Opus 4.6 is live in Rork, and Rork Max is built to assemble apps on top of Claude CodeSIM — A cloud iOS simulator runs in the browser, with one click to install on a device and two clicks to publish to the App StoreMAX — Rork Max emits pure Swift rather than React Native, reaching iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and even iMessageNATIVE — That opens up HealthKit, ARKit and LiDAR, NFC, Dynamic Island, Live Activities, 3D through Metal, and on-device inference with Core MLSEED — Rork raised a $15M seed led by Left Lane Capital, with Peak XV and a16z Speedrun joining the round
Articles/Dev Tools
Dev Tools/2026-07-18Advanced

Stop Spinning Up a Separate Server: Colocate Your Backend With Expo Router API Routes

Standing up yet another Worker just to receive a RevenueCat webhook gets old fast. Expo Router API Routes let you put the backend inside the same repo as your app. Here is the implementation, from signature verification to picking a deployment target.

Expo Router6API RoutesBackend5RevenueCat29Webhook3

Premium Article

Last week I was getting my seventh small app ready to ship, and I stopped mid-task. To receive a RevenueCat webhook, I was about to spin up another Cloudflare Worker, set its environment variables, note the deploy URL, and paste it into a dashboard. I had done this exact dance so many times that my hands knew it before my brain did.

Workers are a fine tool. But every new app meant two new repositories: the app itself, and a tiny server that existed only to serve that app. Versions drifted. I forgot which secret lived where. I would deploy one side and not the other, and things quietly fell out of sync.

That is when I finally took Expo Router's API Routes seriously — and the friction changed. You put the backend in the same repository as the app, under app/api/. This article walks through that implementation using a RevenueCat webhook as the working example, including signature verification and how to choose where to deploy.

The Invisible Cost of One More Standalone Worker

Let me be honest about why I switched to colocating.

As an indie developer running iOS and Android apps for years, the server-side work I actually need tends to be small. Verify an AdMob rewarded SSV callback. Receive a RevenueCat or App Store webhook and write it to my own database. Put a single proxy in front of an API so the key never ships to the client. Each of these is a few dozen lines.

For those few dozen lines, I was provisioning a separate repo and deploy pipeline every single time. Stacked across every app I ship, the cost is not the amount of code — it is the number of things to manage. I had small Workers scattered across six apps, and I could not tell which belonged to which without opening the README.

API Routes are a way to reduce that count. One repo per app. The backend lives inside it.

API Routes Are a Backend That Lives Inside the App

Expo Router API Routes work like this: put a file with the +api.ts suffix inside your app/ directory, and it becomes an endpoint that runs on the server. It is the same file-based routing convention you already use for screens, extended to the server side.

Create app/api/hello+api.ts, and you get an endpoint you can call at /api/hello. Inside, it is a function that takes a standard Web Request and returns a Response. If you have touched Next.js Route Handlers, this will feel almost identical.

There is one prerequisite that trips people up. API Routes need a server runtime, so you must set web.output to "server" in app.json. Miss this, and the build succeeds while every endpoint returns a 404 — a frustrating state to debug because nothing looks broken.

// app.json
{
  "expo": {
    "web": {
      "output": "server"
    }
  }
}

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Receive RevenueCat webhooks with a single app/api/webhook+api.ts file (copy-paste TypeScript included)
Signature verification, where to store secrets, and an EAS Hosting vs. Vercel comparison in one table
The exact rule I use across 6 apps to decide between a colocated route and a standalone Worker
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Dev Tools2026-04-25
Connecting Rork Apps to Zapier — Automate Notifications and Data Sync Without a Backend
Learn how to connect your Rork app to Zapier via Webhooks to automate welcome emails, form data storage, and purchase notifications — no dedicated backend required.
Dev Tools2026-07-15
A Yellow Warning in Dev, a Crash on Resume — Functions in Route Params
Rork generated navigation code that put a function and a Date into route params. In development it was only a warning. After the OS reclaimed the process, resuming the app crashed with params.onFavorite is not a function. Here is the cause and the fix.
Dev Tools2026-06-25
Why Paying Members See a Paywall in Airplane Mode — Keeping RevenueCat Entitlements Alive Offline
Open the app on a weak connection and a paying subscriber sees a paywall flash for a second. Here is how RevenueCat's customerInfo wavers on an offline launch, and a cache design that keeps entitlements valid with a trust window — written as working code for an Expo app.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →