docsify/server.js
John Hildenbiddle 1c5a7013f1
Chore: Clean up server implementation and update test docs (#2316)
- Replace live-server with existing Browsersync dependency as web server
- Remove duplicate `index.html` file
- Add `build:html` script to generate `/docs/preview.html`
2023-12-11 15:00:33 -06:00

14 lines
453 B
JavaScript

import { create } from 'browser-sync';
import serverConfigs from './server.config.js';
const bsServer = create();
const args = process.argv.slice(2);
const configName =
Object.keys(serverConfigs).find(name => args.includes(`--${name}`)) || 'prod';
const settings = serverConfigs[configName];
// prettier-ignore
console.log(`\nStarting ${configName} server (${settings.server.index}, watch: ${Boolean(settings.files)})\n`);
bsServer.init(settings);