-
-
Save EvolverSwiftUI/6dc79993da5c853c9088da38682b6965 to your computer and use it in GitHub Desktop.
Router
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import PerfectLib | |
import PerfectHTTP | |
import PerfectHTTPServer | |
func setupRouter() -> Routes { | |
var routes = Routes() | |
routes.add(method: .get, uri: "/flights") { request, response in | |
FlightsListController().handleFlightsListRequest(request: request, response: response) | |
} | |
routes.add(method: .get, uri: "/details/{id}") { request, response in | |
FlightsDetailController().handleFlightsDetailRequest(request: request, response: response) | |
} | |
return routes | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment