2017-06-15 19:02:08 +02:00
|
|
|
package main
|
|
|
|
|
2020-11-07 11:49:14 +01:00
|
|
|
import "github.com/kataras/iris/v12"
|
2017-06-15 19:02:08 +02:00
|
|
|
|
|
|
|
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,
|
2017-06-15 19:02:08 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
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
|
2020-03-05 21:41:27 +01:00
|
|
|
app.Listen(":8080")
|
2017-06-15 19:02:08 +02:00
|
|
|
}
|