Ultralight http server with live reload.
CLI + API
npm init serve
import serve from 'create-serve';
serve.start();
By default, it serves public
if the folder exists, otherwise root /
.
Or you can specify a different folder.
npm init serve [folder]
import serve from 'create-serve';
serve.start({
port: 7000,
root: '.',
live: true
});
serve.update();
Example with Chokidar
import serve from 'create-serve';
import chokidar from 'chokidar';
serve.start();
chokidar.watch('.').on('change', () => {
serve.update();
});