static

package module
v0.0.0-...-d923cc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 7 Imported by: 1

README

Static

Simple static middleware for chi based on gin-contrib/static

Extra Features
  • Auto ContentType
  • Works with any prefix

Documentation

Index

Constants

View Source
const INDEX = "index.html"

Variables

This section is empty.

Functions

func LocalFile

func LocalFile(root string, index bool) *localFileSystem

func Serve

func Serve(urlPrefix string, location string, index bool) func(next http.Handler) http.Handler

Static returns a middleware handler that serves static files in the given directory.

Types

type ServeFileSystem

type ServeFileSystem interface {
	http.FileSystem
	Exists(prefix string, path string) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL