             userGroup.post("new", handler: UserController.create)
             userGroup.grouped(passwordProtect).post("login", handler: UserController.login)
             userGroup.post("logout", handler: UserController.logout)
+        }
+    }
+
+    private func addViewRoutes(_ builder: RouteBuilder) throws {
+        builder.get {req in
+            guard req.auth.isAuthenticated(User.self) else { return Response(redirect: "/users/login") }
+
+            return Response(redirect: "/wall")
+        }
+
+        builder.grouped(passwordProtect).get("wall") {req in
+            return try self.view.make("post.html")
         }
 
         builder.group("users") {userGroup in

    }

    func build(_ builder: RouteBuilder) throws {
        builder.get {req in
            guard req.auth.isAuthenticated(User.self) else { return Response(redirect: "/users/login") }

            return Response(redirect: "/wall")
        }

        builder.grouped(passwordProtect).get("wall") {req in
            return try self.view.make("post.html")
        }

        builder.grouped("api").grouped(passwordProtect).group("post") {postGroup in
            postGroup.post(handler: PostController.create)
        }

                return try self.view.make("users/logout.html")
            }
        }
    }
}
