Giter VIP home page Giter VIP logo

statikk's Introduction

Statikk NPM statikk package

A simple and secure server for static files.

  • Pithy flags for CORS and Cross-origin isolation.
  • Two smart security defaults:
    1. Your .git files are not exposed. (Whereas ALL other simple http servers do expose this security concern (except serve))
    2. The server isn't accessible outside of localhost. Other folks on your network won't be able to browse it via your internal IP.
  • If you don't specify a port, it'll be deterministically generated based on your working directory. ๐ŸŽ‰

Command line usage

$ npm install -g statikk

$ cd ~/Sites/fidgetspin.xyz

$ statikk --cors --open
๐Ÿค“ Served by statikk: http://localhost:10810

Command line options

  • --port NNNN: custom port. If not specified, it'll use a port automagically based on process.cwd(). (So different projects use different ports!)
  • --open: Open the hosted URL in your default browser. (Only supported on Mac OS!)
  • --cors: Add CORS headers
  • --coi: Add cross-origin isolation headers (more)

These two impair security:

  • --hidden: allow transfer of hidden files.
  • --expose: expose server to hosts other than localhost.

All non-port options default to false.

Examples

// Start server at http://localhost:9000 serving ./
$ statikk --port 9000

// Start server at http://localhost:60384 (perhaps) serving ~/Sites/project
$ statikk ~/Sites/project

// Start server at a deterministically-chosen port based on the working directory, and open the browser
$ statikk --open

History

This project is a fork of...

The original project doesn't correctly exclude all hidden files, which is why I've forked and republished. ~paul irish. june 2017.

statikk's People

Contributors

hongymagic avatar paulirish avatar johnkelly avatar boardman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.