UNPKG

create-serve

Version:

🍛 Ultralight http server with live reload. [CLI + API]

10 lines (7 loc) 241 B
import fs from 'fs'; import { options, defaultRoot } from '../index.js'; export const setRoot = () => { const { root } = options; const isRoot = !root || root == '.'; return isRoot && fs.existsSync(defaultRoot) ? defaultRoot : root; };