mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
* rename exported functions * replace monaco editor with compiled version * fixes * cancel old API requests
14 lines
345 B
TypeScript
14 lines
345 B
TypeScript
import { NextApiRequest, NextApiResponse } from "next";
|
|
import html2pug from "html2pug";
|
|
|
|
export default (req: NextApiRequest, res: NextApiResponse) => {
|
|
try {
|
|
const { value, settings } = req.body;
|
|
|
|
const result = html2pug(value, settings);
|
|
res.status(200).send(result);
|
|
} catch (e) {
|
|
res.status(500).send(e.message);
|
|
}
|
|
};
|