This commit is contained in:
2026-05-25 09:12:22 +03:30
parent 19e53d4b97
commit aae6a4b49b
13 changed files with 4770 additions and 48 deletions
+4 -2
View File
@@ -1,11 +1,13 @@
import { NextRequest, NextResponse } from 'next/server';
import { writeFile, readFile } from 'fs/promises';
import { mkdir, writeFile, readFile } from 'fs/promises';
import path from 'path';
const filePath = path.resolve(process.cwd(), 'contactMessages.json');
const filePath = path.resolve(process.cwd(), 'data', 'contactMessages.json');
export async function POST(request: NextRequest) {
try {
await mkdir(path.dirname(filePath), { recursive: true });
const body = await request.json();
const { first_name, last_name, phone, email, message } = body;