const path = require("path"); require("dotenv").config({ path: path.resolve( process.cwd(), `.env.${process.env.NODE_ENV || "development"}` ), }); const inlineCssTool = require("inline-css"); exports.inlinecss = (req, res) => { //Perform request validation console.log("[CSS] New Inline CSS Request."); const { html, url } = req.body; inlineCssTool(html, { url: url }) .then((inlinedHtml) => { res.send(inlinedHtml); }) .catch((error) => res.send(error)); };