Code Monkey home page Code Monkey logo

tstatic's Introduction

tstatic

CircleCI npm npm

The only static-file server you'll ever need!

Features:

Usage

  tstatic <dir> [options]

  -h --help     Show this screen.
  --version     Show version.
  -p <port> --port=<port>  Port to listen on.
  -b <auth> --basic-auth=<auth>   Enable basic-auth.
  -i <ips> --ips=<ips>  Allowed IP addresses.
  -l --list-dir  List Directory.
  -o --open  Open in browser after start.

dir is where your static files are.

404 errors will return with <dir>/.404.html, with status code 404. If this file doesnt exist, the default error page will be shown.

Configuration

port

The port for the server to listen on. Currently supports plain HTTP only

basic-auth

Enable basic-auth for all paths. Currently only supports single credentals.

Format:-b username:password

ips

IP addresses that are allowed to connect to the server.

Format: -i 192.168.1.100,192.168.1.101

list-dir

Enables directory listing. Allow browseing

open

Open the server in the browser one started. It will open in your default browser, and use url http://0.0.0.0:<port>.

Docker

Included in this repo is a Dockerfile to use. The default setup requires being run from the project directory, and will serve /var/www in the container on port 5000. By default, this directory is contains a simple index file, however can be overriden.

Below is an example docker-compose.yml file you can use with it:

version: "2"
services:
  tstatic:
    image: "tstatic"
    build:
        context: .
        dockerfile: Dockerfile
    volumes:
        - ./site/:/var/www
    ports:
        - "5000:5000"

tstatic's People

Contributors

jakesidsmith avatar lionc avatar realorangeone avatar

Watchers

 avatar  avatar  avatar

Forkers

jakesidsmith

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.