                 return try self.view.make("users/logout.html")
             }
         }
-
-        builder.socket("ws") {req, ws in
-            Gateway.shared.add(ws)
-
-            ws.onClose = {ws, code, reason, clean in
-                Gateway.shared.remove(ws)
-            }
-        }
     }
 }

    }

    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)
        }

            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
