flickserve
v1.0.1
Published
🍛 Ultralight http server with live reload. [CLI + API]
Downloads
1
Maintainers
Readme
flickserve 🍛
Ultralight http server with live reload.
CLI + API
This is fork of nativew/serve. I missed fallback option usefull for apps with react router
Simple CLI and API
With live reload
Light and modern
No dependencies
One command
npm init flickserve
Or one function
import flickserve from 'flickserve';
flickserve.start();
To start 🍛
CLI
By default, it serves public
if the folder exists, otherwise root /
.
Or you can specify a different folder.
npm init flickserve [folder]
API
import flickserve from 'flickserve';
flickserve.start({
port: 7000,
root: '.',
fallback: undefined, // set to "index.html", great for react router etc.
live: true
});
Live reload
serve.update();
Use any file watcher
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
Log
Import the util functions to log updates with colours.
import flickserve, { error, log } from 'flickserve';
flickserve.update();
hasError
? error('× Failed') // Red
: log('✓ Updated'); // Green