33 lines
592 B
Go
Raw Normal View History

2016-11-09 11:32:19 +00:00
package main
import (
"io/ioutil"
2016-11-09 13:11:49 +00:00
"github.com/aerogo/aero"
2016-11-12 16:40:16 +00:00
"github.com/animenotifier/notify.moe/components"
2016-11-09 11:32:19 +00:00
)
var app = aero.New()
func main() {
2016-11-13 15:34:01 +00:00
app.SetStyle(components.BundledCSS)
2016-11-09 11:32:19 +00:00
scripts, _ := ioutil.ReadFile("temp/scripts.js")
js := string(scripts)
app.Get("/scripts.js", func(ctx *aero.Context) string {
ctx.SetHeader("Content-Type", "application/javascript")
return js
})
2016-11-12 16:40:16 +00:00
app.Get("/hello", func(ctx *aero.Context) string {
return "Hello World"
})
2016-11-09 11:32:19 +00:00
app.Layout = func(ctx *aero.Context, content string) string {
2016-11-12 16:40:16 +00:00
return components.Layout(content)
2016-11-09 11:32:19 +00:00
}
app.Run()
}