route.ts

src/app/api/submit-form/route.ts
import { studioUrl } from '@/utils/studio-helpers'
import { NextResponse } from 'next/server'
export const runtime = 'nodejs'
function encodeFormData(data: Record<string, any>) {
const fd = new FormData()
for (const [k, v] of Object.entries(data)) {
if (Array.isArray(v)) for (const item of v) fd.append(k, item as any)
else if (v !== undefined && v !== null) fd.append(k, v as any)
}
return fd
}
function escapeHtml(s: string) {
return s
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC