mirror of
https://github.com/ritz078/transform.git
synced 2026-12-05 06:04:59 +03:00
13 lines
356 B
TypeScript
13 lines
356 B
TypeScript
import { NextApiRequest, NextApiResponse } from "next";
|
|
import html2pug from "html2pug";
|
|
|
|
export default (req: NextApiRequest, res: NextApiResponse) => {
|
|
try {
|
|
const { value, settings } = JSON.parse(req.body);
|
|
const result = html2pug(value, settings);
|
|
res.status(200).send(result);
|
|
} catch (e) {
|
|
res.status(500).send(e.message);
|
|
}
|
|
};
|