Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Sources/App/Features/Engage/EngageRouteController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Vapor

struct EngageRouteController: RouteCollection {
func boot(routes: any RoutesBuilder) throws {
routes.webSocket("engage") { req, ws in
ws.pingInterval = .seconds(50)

ws.onBinary { ws, message in
ws.send("received")
}

ws.onText { ws, message in
ws.send("received")
}
}
}
}
1 change: 1 addition & 0 deletions Sources/App/routes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func routes(_ app: Application) throws {
try app.routes.register(collection: TicketLoginController())
try app.routes.register(collection: TicketHubRouteController())
try app.routes.register(collection: PurchaseRouteController())
try app.routes.register(collection: EngageRouteController())

// MARK: - API Routes

Expand Down
Loading