A lightweight easy-to-use http-server for static content.
- 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
GET and HEAD
HTTP/1.0
Tiny1 is more of an exercise project, which probably makes it unsuitable for production environments.
- Java 11
To spin up an instance of tiny1 with its defaults, follow these 5 simple steps:
- Clone the project:
git clone https://github.com/stefanoskapa/tiny1.git
- Move to the tiny1 directory
cd tiny1
- Build the jar:
gradlew build
- Move to the build directory
cd /build/libs
- Start the server!
java -jar tiny1.jar
Tiny1 works out-of-the-box, with the following defaults:
Port: 8000 Document root: /static
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.
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