2020-02-02 15:29:06 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/kataras/iris/v12"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
addr = "example.com:80"
|
|
|
|
subdomain = "v1"
|
|
|
|
)
|
|
|
|
|
|
|
|
func newApp() *iris.Application {
|
|
|
|
app := iris.New()
|
|
|
|
app.Favicon("./assets/favicon.ico")
|
|
|
|
|
|
|
|
v1 := app.Subdomain(subdomain)
|
2020-07-24 12:03:49 +02:00
|
|
|
v1.HandleDir("/", iris.Dir("./assets"))
|
2020-02-02 15:29:06 +01:00
|
|
|
|
|
|
|
// http://v1.example.com
|
|
|
|
// http://v1.example.com/css/main.css
|
|
|
|
// http://v1.example.com/js/jquery-2.1.1.js
|
|
|
|
// http://v1.example.com/favicon.ico
|
|
|
|
return app
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := newApp()
|
2020-03-05 21:41:27 +01:00
|
|
|
app.Listen(addr)
|
2020-02-02 15:29:06 +01:00
|
|
|
}
|