iris/_examples/file-server/single-page-application/basic/main.go

24 lines
381 B
Go
Raw Normal View History

package main
2020-11-07 11:49:14 +01:00
import "github.com/kataras/iris/v12"
func newApp() *iris.Application {
app := iris.New()
2020-11-07 11:49:14 +01:00
app.HandleDir("/", iris.Dir("./public"), iris.DirOptions{
IndexName: "index.html",
SPA: true,
})
return app
}
func main() {
app := newApp()
// http://localhost:8080
2020-11-07 11:49:14 +01:00
// http://localhost:8080/about
// http://localhost:8080/a_notfound
app.Listen(":8080")
}