Skip to content

goforgery/static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

static

Build Status

Static file server for Forgery2.

Install

go get github.com/goforgery/static

Use

By default files are served from a folder named ./public in the directory where Forgery2 is started. For example if you have a the file ./public/text.txt and you start the server in ./, the file will be served from the URL http://localhost:3000/text.txt.

package main

import (
	"github.com/goforgery/forgery2"
	"github.com/goforgery/static"
)

func main() {
	app := f.CreateApp()
	app.Use(static.Create())
	app.Listen(3000)
}

Test

go test

About

Static file server for Forgery2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages