12 lines
290 B
TypeScript
12 lines
290 B
TypeScript
import type { NextApiRequest, NextApiResponse } from "next";
|
|
import { html } from "@/store";
|
|
|
|
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
if (req.method === "POST") {
|
|
html.set(req.body.html);
|
|
}
|
|
res.status(200).json({
|
|
html: html.get(),
|
|
});
|
|
}
|