Beispiel #1
0
func JSONPost(request *atlas.Request) *atlas.Response {
	var data map[string]string
	err := request.JSONPost(&data)

	if err != nil {
		return atlas.Error(500, err)
	}

	return atlas.Success(data)
}
Beispiel #2
0
func PostName(request *atlas.Request) *atlas.Response {
	return atlas.Success(request.Form.Get("name"))
}
Beispiel #3
0
func QueryString(request *atlas.Request) *atlas.Response {
	return atlas.Success(request.Query)
}
Beispiel #4
0
func User(request *atlas.Request) *atlas.Response {
	return atlas.Success(&Person{request.Params["name"], request.Params["surname"]})
}
Beispiel #5
0
func Now(request *atlas.Request) *atlas.Response {
	return atlas.Success(time.Now())
}
Beispiel #6
0
func Hello(request *atlas.Request) *atlas.Response {
	return atlas.Success("Hello World")
}