Ultralight http server with live reload.
CLI + API
This is fork of nativew/serve. I missed fallback option usefull for apps with react router
npm init flickserve
import flickserve from 'flickserve';
flickserve.start();
By default, it serves public
if the folder exists, otherwise root /
.
Or you can specify a different folder.
npm init flickserve [folder]
import flickserve from 'flickserve';
flickserve.start({
port: 7000,
root: '.',
fallback: undefined, // set to "index.html", great for react router etc.
live: true
});
serve.update();
import flickserve from 'flickserve';
import chokidar from 'chokidar';
flickserve.start();
chokidar.watch('.').on('change', () => {
flickserve.update();
});
Use the official wrapper for esbuild's watch β esbuild-serve
Import the util functions to log updates with colours.
import flickserve, { error, log } from 'flickserve';
flickserve.update();
hasError
? error('Γ Failed') // Red
: log('β Updated'); // Green