Example #1
0
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, "/")
}
Example #2
0
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))
}
Example #3
0
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)
}