mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
d556cfc39a
Former-commit-id: ca20d256b766e3e8717e91de7a3f3b5f213af0bc
25 lines
674 B
Go
25 lines
674 B
Go
package main
|
|
|
|
import (
|
|
"github.com/kataras/iris/v12"
|
|
)
|
|
|
|
func main() {
|
|
app := iris.New()
|
|
app.Get("/", func(ctx iris.Context) {
|
|
ctx.HTML("<b>Hello!</b>")
|
|
})
|
|
// [...]
|
|
|
|
// Good when you have two configurations, one for development and a different one for production use.
|
|
// If iris.YAML's input string argument is "~" then it loads the configuration from the home directory
|
|
// and can be shared between many iris instances.
|
|
cfg := iris.YAML("./configs/iris.yml")
|
|
addr := cfg.Other["Addr"].(string)
|
|
app.Listen(addr, iris.WithConfiguration(cfg))
|
|
|
|
// or before run:
|
|
// app.Configure(iris.WithConfiguration(iris.YAML("./configs/iris.yml")))
|
|
// app.Listen(":8080")
|
|
}
|