A blazing fast web server to static files-serving powered by Rust Iron. :zap:
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jose Quintana 91ae15fc69
1.0.0-beta.3
1 month ago
.vscode PR 1.0.0-beta.2 (#6) 2 months ago
docker 1.0.0-beta.2 2 months ago
public PR 1.0.0-beta.2 (#6) 2 months ago
scripts PR 1.0.0-beta.2 (#6) 2 months ago
src PR 1.0.0-beta.2 (#6) 2 months ago
.dockerignore PR 1.0.0-beta.2 (#6) 2 months ago
.drone.yml chore: add slack pipeline notification 2 months ago
.gitignore PR 1.0.0-beta.2 (#6) 2 months ago
Cargo.lock 1.0.0-beta.3 1 month ago
Cargo.toml 1.0.0-beta.3 1 month ago
LICENSE-APACHE feat: dual licensing 1 month ago
LICENSE-MIT feat: dual licensing 1 month ago
Makefile feat: add tasks info 1 month ago
README.md feat: dual licensing 1 month ago
Tasks.Dev.toml PR 1.0.0-beta.2 (#6) 2 months ago
Tasks.Prod.toml PR 1.0.0-beta.2 (#6) 2 months ago

README.md

Static Web Server Build Status

A fast web server to static files-serving powered by Rust Iron. :zap:

Static Web Server is an small (1,6M static binary) and fast web server to serving static files. Which is also suitable to deploy it into a Docker container.

Status: The status is WIP so feel free to contribute.

Usage

Server is configurated via environment variables:

  • SERVER_NAME: Name for server. Default nameless.
  • SERVER_HOST: Host address (E.g 127.0.0.1). Default [::].
  • SERVER_PORT: Host port. Default 80.
  • SERVER_ROOT: Root directory path of static files. Default /public.
  • SERVER_ASSETS: Assets directory path for add cache headers functionality. Default /public/assets.

Docker stack

Example using Traefik proxy

version: "3.3"

services:
  web:
    image: joseluisq/static-web-server:latest
    environment:
        - SERVER_NAME=my-server
        - SERVER_HOST=127.0.0.1
        - SERVER_PORT=80
        - SERVER_ROOT=/html
        - SERVER_ASSETS=./assets
    volumes:
        - ./some-dir-path:/html
    labels:
        - "traefik.enable=true"
        - "traefik.frontend.entryPoints=https"
        - "traefik.backend=localhost_dev"
        - "traefik.frontend.rule=Host:localhost.dev"
        - "traefik.port=80"
    networks:
        - traefik_net

networks:
    traefik_net:
        external: true

Development

~> make help

Static Web Server
Web Server to static files-serving.

Please use `make <target>` where <target> is one of:
    install           to install dependencies.
    run               to run server in development.
    watch             to run server (watch files mode) in development.
    release           to build a release.
    docker_image      to build a Docker image.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.

Feel free to send some Pull request or issue.

License

This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

© 2019 Jose Quintana