Where danwo runs
Full-stack app
One app that serves both pages and API, started by danwo. Everything works.
Your app serves its pages and its API from one server: Next.js with API routes and server actions, Remix, Nuxt, SvelteKit, or a plain Node server. danwo starts it, so every call it makes goes through danwo's proxy. This is the setup with the most coverage.
Set it up
Give danwo the command that starts your app and where it answers. List the services your app calls:
import { appEnvironment, defineConfig, resendService, stripeService } from "@danwo/sdk"
export default defineConfig({
testDir: "tests",
environment: () =>
appEnvironment({
app: { command: "npm run dev", url: "http://localhost:3000" },
services: [stripeService(), resendService()],
}),
})danwo runs npm run dev with its proxy settings and a test certificate. When your server calls
api.stripe.com, the Stripe emulator answers. Your code doesn't change.
What you get
| You can | How |
|---|---|
| Drive pages, with locators or the agent | Agent and locators |
| Emulate what the server and the browser call | the services list |
| Break any call, webhook or database statement | danwo matrix |
| Start every test from clean state | Isolation |
| Move time forward | Time travel: the app's clock, the emulators', the page's |
Next.js: routes, edge, middleware and server actions
We checked Next.js 16.4.2 under both next dev and next start. These all reached the Stripe
emulator through danwo's proxy:
| Where the call is made | next dev | next start |
|---|---|---|
| Route handler, Node runtime | ✓ | ✓ |
Route handler, runtime = "edge" | ✓ | ✓ |
| Server component | ✓ | ✓ |
| Middleware | ✓ | ✓ |
The same app started without danwo reached the real Stripe from all four. Edge routes and middleware work because, on your machine, Next.js runs them inside its own Node server process, which danwo started.
Server actions run in that same server process, like server components, so their calls go through the proxy too.
This holds when danwo starts the server on your machine. A deployment to an edge network (Vercel, Netlify, Cloudflare) runs outside danwo: test it as staging.
Pitfalls
- A build that fetches during start-up. Fonts or remote config fetched at build time go
through the proxy too. Pass
unmatched: "passthrough"(the default) or add those hosts toallowwhen you block the rest. The page's own images and fonts still load under block; see Outside hosts. - A start script that sets
NODE_OPTIONS. danwo keeps its settings anyway, through a smallnodewrapper on the app'sPATH. See Real stacks. - Other runtimes. danwo covers Node and Bun servers. We haven't checked Deno, or
wrangler devfor Cloudflare Workers, yet.