Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (21 sloc) 640 Bytes
// Package main provide one-line integration with letsencrypt.org
package main
import (
"github.com/kataras/iris"
)
func main() {
app := iris.New()
app.Get("/", func(ctx iris.Context) {
ctx.Writef("Hello from SECURE SERVER!")
})
app.Get("/test2", func(ctx iris.Context) {
ctx.Writef("Welcome to secure server from /test2!")
})
app.Get("/redirect", func(ctx iris.Context) {
ctx.Redirect("/test2")
})
// NOTE: This will not work on domains like this,
// use real whitelisted domain(or domains split by whitespaces)
// and a non-public e-mail instead.
app.Run(iris.AutoTLS(":443", "example.com", "mail@example.com"))
}