Skip to content

wtff0nzie/simpl3s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simpl3s

Small, fast, quick and easy node.js file flinger with a silly name.

Features

  • Small static file HTTP server
  • Fast!
  • CSS/HTML/JS files are automatically minified and gzipped
  • JSON/SVG/TXT/XML file are automatically gzipped
  • Silly name

Quick usage

require('simpl3s').standAloneServer();

Sample configuration

const simpl3s = require('simpl3s'),
    config = {
        gzip    : true,
        minify  : true,
        port    : 8081,
        path    : './public'
    };

simpl3s.standAloneServer(config);

Complete configuration

const simpl3s = require('simpl3s'),
    config = {
        etag        : true,
        gzip        : true,
        immutable   : true,
        maxAge      : 181635468200,
        minify      : true,
        path        : './www',
        port        : 8080
    };

simpl3s.standAloneServer(config);

Serve a single file

const simpl3s = require('simpl3s'),
    server = require('http'); 

server
    .createServer(simpl3s.serveFile)
    .listen(8080);

Just optimise static assets

require('simpl3s').speedify({}, './public');

Notes

Explicit port configuration will be ignored if a cloud environment is detected. Defaults to 8080 when no port is specified.

Installation

npm

  • npm install simpl3s

About

Small and fast node.js HTTP file flinger.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published