Skip to content

A lightweight easy-to-use http-server for static content

Notifications You must be signed in to change notification settings

stefanoskapa/tiny1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny1

A lightweight easy-to-use http-server for static content.

Features

  • Serves at breakneck speed
  • Binary size under 50kb
  • Multi-platform (Windows, Linux, MacOS etc.)
  • TLS support
  • Build-in MIME types for 900+ extensions
  • 301 redirects
  • HEAD method

Supported methods

GET and HEAD

HTTP implementation

HTTP/1.0

Security

Tiny1 is more of an exercise project, which probably makes it unsuitable for production environments.

Requirements

  • Java 11

Build and Run

To spin up an instance of tiny1 with its defaults, follow these 5 simple steps:

  1. Clone the project:

git clone https://github.com/stefanoskapa/tiny1.git

  1. Move to the tiny1 directory

cd tiny1

  1. Build the jar:

gradlew build

  1. Move to the build directory

cd /build/libs

  1. Start the server!

java -jar tiny1.jar

Default Configuration

Tiny1 works out-of-the-box, with the following defaults:

Port: 8000 Document root: /static

Custom Configuration

Tiny1 allows a couple of configurations that may make your life easier. However, if the command-line arguments are too many, consider creating a deployment script.

Redirects

You can set 301 redirects with the --redirect option, which accepts two urls separated by space. The first url must be relative to your context, while the second needs to be absolute. Here is an example:

java -jar tiny1.jar --redirect / https://www.google.com

About

A lightweight easy-to-use http-server for static content

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages