Coder Social home page Coder Social logo

sundowndev / serve Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 2.0 47 KB

Simple, production ready, HTTP server for static file serving

License: MIT License

Dockerfile 20.87% Go 77.44% HTML 1.69%
http-server static-file static-server production-ready

serve's Introduction

serve

action Go Report Card release

Lightweight, simple, production ready HTTP server for static file serving.

Installation

# Download the archive
$ curl -L "https://github.com/sundowndev/serve/releases/download/v1.1.0/serve_$(uname -s)_$(uname -m).tar.gz" -o serve.tar.gz

# Extract the binary
$ tar xfv serve.tar.gz

# Run the software
$ ./serve -h

# You can install it globally
$ mv ./serve /usr/bin/serve

If the installation fails, it probably means your OS/arch is not suppored.

Please check the output of echo "$(uname -s)_$(uname -m)" in your terminal and see if it's available on the GitHub release page.

Usage

Here's the help message :

$ serve -h

Usage of http_server:
  -addr string
    	The address to listen to.
  -port string
    	The port to listen to.
  -prefix string
    	The URI prefix path.
  -root string
    	the directory to serve files from.

Launch a HTTP server to serve files in the current directory :

$ serve -root . -port 8080 

Docker image

Launch a HTTP server to serve files in the public directory :

$ docker run -it --rm -v $PWD/public:/app/public:ro -p 80:80 sundowndev/serve -root public

Using compose

version: '3.7'

services:
    serve:
      container_name: serve
      restart: on-failure
      image: sundowndev/serve:latest
      command: "-root ./public"
      volumes:
        - ./fixtures:/app/public:ro
      ports:
        - "80:80"

License

This project is MIT Licensed.

serve's People

Contributors

elgohr avatar sundowndev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

5l1v3r1

serve's Issues

TLS support

Goal: add ability to serve files over HTTPS. Create flags to register cert and key files.

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.