func AdminNewPost(ctx *web.Context, val string) { //reg := map[string]string{"newpost": getnewpost(), //"newuser": getnewuser()} fmt.Println("We're in!") fmt.Println(ctx.Params) ctx.Redirect(304, "/") }
func Sendstatic(ctx *web.Context, val string) { file, _err := ioutil.ReadFile("static/" + val) if _err != nil { return } filetype := strings.Split(val, ".") ctx.ContentType(filetype[len(filetype)-1]) ctx.WriteString(string(file)) }
func AdminLoadGet(ctx *web.Context, val string) { reg := map[string]string{"newpost": getnewpost(), "newuser": getnewuser()} output := "" if len(ctx.Params) == 0 { output = defaultpage(ctx) } else { output = reg[ctx.Params["mode"]] } ctx.WriteString(output) }