Added new route tests

This commit is contained in:
2017-10-01 07:24:56 +02:00
parent 5fc07782b9
commit e646410fc2
2 changed files with 69 additions and 22 deletions

View File

@ -14,6 +14,7 @@ func init() {
app.Rewrite(func(ctx *aero.RewriteContext) {
requestURI := ctx.URI()
// User profiles
if strings.HasPrefix(requestURI, plusRoute) {
newURI := "/user/"
userName := requestURI[2:]
@ -28,6 +29,7 @@ func init() {
return
}
// Search
if strings.HasPrefix(requestURI, "/search/") {
searchTerm := requestURI[len("/search/"):]
ctx.Request.URL.RawQuery = "q=" + searchTerm
@ -42,6 +44,7 @@ func init() {
return
}
// Analytics
if requestURI == "/dark-flame-master" {
ctx.SetURI("/api/new/analytics")
return