iris/_examples/file-server/embedding-files-into-app/main.go
Gerasimos Maropoulos b20933e0bb upgrade go-bindata link to the most maintainable one
Former-commit-id: 58d5253b3332acef480d36f0cf716f2ad6b1c09e
2018-02-25 12:14:49 +02:00

30 lines
644 B
Go

package main
import (
"github.com/kataras/iris"
)
// Follow these steps first:
// $ go get -u github.com/shuLhan/go-bindata/...
// $ go-bindata ./assets/...
// $ go build
// $ ./embedding-files-into-app
// "physical" files are not used, you can delete the "assets" folder and run the example.
func newApp() *iris.Application {
app := iris.New()
app.StaticEmbedded("/static", "./assets", Asset, AssetNames)
return app
}
func main() {
app := newApp()
// http://localhost:8080/static/css/bootstrap.min.css
// http://localhost:8080/static/js/jquery-2.1.1.js
// http://localhost:8080/static/favicon.ico
app.Run(iris.Addr(":8080"))
}