Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tstatic

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tstatic

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

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

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 /public in the container on port 5000. By default, this directory is empty, 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/:/public
    ports:
        - "5000:5000"

Note: tstatic isn't installed into the path, so run it using npm start --

FAQs

Package last updated on 21 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc