nuxt build writes a folder that runs almost anywhere: as a Node process on your own box, as a serverless function on a managed host, as a worker at the edge, under Deno or Bun. Where a route ends up running is decided at build time rather than while you write it. Writing the handler for a contact form takes five minutes. It gets harder six weeks later, when it is writing into nothing and nobody notices.
Why Nitro leaves the deploy target open
Underneath Nuxt sits Nitro, a server of its own. nuxt build produces .output/ with it: a directory that brings its dependencies along and starts with node .output/server/index.mjs. The preset decides what shape it takes - NITRO_PRESET=node-server for the classic process, plus presets for the usual hosts, for edge workers, and for Deno and Bun. Nitro recognises known environments by itself, so the preset is usually one line in your deploy configuration rather than in nuxt.config.ts.
A route that accepts form data is correspondingly cheap: a file under server/api/ that exports a defineEventHandler. Nuxt scans the directory and registers it, and the .post.ts suffix binds the handler to POST.
Next.js can do the same in principle. It self-hosts as a standalone build or in a container, and has done so reliably for years. The difference is more in what a change of target costs you, an environment variable on one side and a decision that gets discussed first on the other. SvelteKit stands in the same place with its adapters. And whoever runs nuxt generate ends up alongside Hugo and the other static generators on purpose, with a folder that receives nothing.
Nobody reports silence
The handler is written, deployed, and it works. Six weeks later a caller wants to know what happened to the enquiry they sent ten days ago.
A form that has stopped delivering looks, from the inside, exactly like one nobody filled in. Nothing throws, and no red line shows up in your logs. Your relay accepted the mail with a 250; what happened after that, a junk folder or a block against your sending IP, is in no log that belongs to you. And your own logs live as long as the platform behind your preset keeps them. Finding an outage like that means going looking for it, sending a test submission every hour and reading a bounce mailbox that somebody actually owns. In practice, that rarely gets its own ticket.
The second part concerns the people who come after you. A year from now a colleague opens this file and finds a rate limit with a number in it, a list of patterns, a DKIM selector and a job that deletes rows. Why the number is 30 and not 5, or which spam wave triggered the third rule, was never written down anywhere except maybe a thread. If she leaves it alone, it ages further. If she tidies it up, you find out weeks later, from the recipient’s spam folder.
What ages there is the same in every stack with a server - domain reputation, a rate limit across several instances, bot detection, a period that gets enforced - and the Next.js piece lists it item by item. What comes on top here follows directly from the advantage above. The portable part of Nitro is the stateless part, and everything that has to remember something falls outside it. A function that starts per request has no directory for a submission to sit in, and no process in which a cron wakes up at three in the morning. One reason you picked Nuxt is that the deploy target does not pin you down. The stateful part undoes that as soon as you build it yourself.
Wiring it up
A <form> may point its action at a foreign domain, and a Vue file changes nothing about that: whatever you put in the <template> reaches the HTML unchanged.
<template>
<main>
<h1>Contact</h1>
<!-- no script setup, no state, nothing to hydrate -->
<form action="https://api.formdall.de/api/v1/f/kx92m4" method="POST">
<label for="name">Name</label>
<input id="name" name="name" required>
<label for="email">Email</label>
<input id="email" name="email" type="email" required>
<label for="message">Message</label>
<textarea id="message" name="message" rows="6"></textarea>
<button type="submit">Submit</button>
</form>
</main>
</template>The page is an ordinary route under pages/ with no <script setup>. Nuxt renders the form on the server, the submit is an ordinary browser POST - it arrives even when the client bundle gets stuck on the way. You set the visitor’s destination per form.
The other variant puts a route of your own in between - for your server-side validation, or when the enquiry also belongs in your database.
export default defineEventHandler(async (event) => {
const submission = await readFormData(event)
// your own validation belongs here
try {
// without this header the endpoint answers with a redirect, which $fetch follows silently
await $fetch('https://api.formdall.de/api/v1/f/kx92m4', {
method: 'POST',
headers: { Accept: 'application/json' },
body: submission,
})
} catch (cause) {
// $fetch throws on 4xx and 5xx; failing quietly is what must not happen
throw createError({ statusCode: 502, cause })
}
// thanksPath comes from nuxt.config.ts under runtimeConfig, e.g. '/thanks'
return sendRedirect(event, useRuntimeConfig(event).thanksPath, 303)
})readFormData landed in Nuxt 3.7. Switching happens in one place: action then holds /api/contact instead of the Formdall URL. A <form> has only one action; the two versions above are two values for the same attribute, not two pieces stacked on each other. This path works without JavaScript too, because your route answers with a redirect itself; thanksPath can be set per target through NUXT_THANKS_PATH - the place where your presets differ anyway. The header above it separates the two directions: with Accept: application/json the endpoint answers in JSON, without it with a redirect - Formdall decides that from the request. None of this needs typing: get_embed returns the markup, it goes into your <template> unchanged, and create_form lays out the form and its field schema.
What you are not building
Somewhere a submission has to sit, and .output/ has no place set aside for it, whichever preset you built. With us it is stored encrypted in a database on servers in Germany - in a system you do not operate and do not take along when your target is called something else next quarter.
It does not stay there forever either. A job runs once a day and physically deletes whatever has passed its retention period, with no column called deleted_at standing in for it. It is also the part that fits your deployment worst: a job at a fixed hour, in an environment that starts per request and disappears again.
There is still one way back into your application, and it is a file under server/api/ again. Webhooks go out with an HMAC signature per form, plus SSRF protection against internal targets: you check the signature and write the submission wherever it belongs in your product. That one route will still make sense to the colleague above in a year, because it does something for you. A domain with a reputation, a filter and a deletion job still have to be kept running by somebody, and nobody notices them until they stop. Here, that somebody is not you. Three forms and 100 submissions per month cost nothing, and you do not need a credit card for it.