flickserve

1.0.1 • Public • Published

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


Chokidar

import flickserve from 'flickserve';
import chokidar from 'chokidar';

flickserve.start();

chokidar.watch('.').on('change', () => {
    flickserve.update();
});

esbuild

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



Package Sidebar

Install

npm i flickserve

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

18.4 kB

Total Files

22

Last publish

Collaborators

  • alesij