Files
transform/pages/api/html-to-pug.ts
T
Ritesh Kumar b69461b66e fix(ts-schema): typescript to JSON Schema now working (#183)
* updated dependencies

* fix(ts-schema): typescript to JSON Schema now working

fix #182

* added more data in typescript value

* updated svgr

* updated jsonld

* update dependencies

* added stale bot

* fixes

* fixes

* fixes
2020-06-05 01:50:14 +05:30

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);
}
};