UNPKG

specpress

Version:

Export PDF and/or DOCX files from a subset of Markdown, ASN.1 and JSON files

18 lines (16 loc) 516 B
import { exec } from "child_process"; import { normalize } from "path"; export function serveLocalhostFromPublicFolder( pathRootFolder, pathPublicFolder ) { const httpServerBin = normalize(`${pathRootFolder}/node_modules/specpress/node_modules/.bin/http-server`); const npmCommand = `"${httpServerBin}" "${pathPublicFolder}" -c-1 -p 8080`; exec(npmCommand, (error, stdout, stderr) => { if (error) { console.error(`Error: ${error.message}`); return; } console.log(`Child stdout: ${stdout}`); }); }