Created
April 6, 2016 08:10
-
-
Save flandy84/27128286fd045ecc04a6d63d017954ce to your computer and use it in GitHub Desktop.
This file contains 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 Inquiline | |
import Swifton | |
import SharedCode | |
class LoginController: Controller { | |
override init() { | |
super.init() | |
action("login") {request in | |
let loginRequest = LoginRequest(json: JSON.parse(request.body ?? "")) | |
let loginResponse = LoginResponse(text: "Hallo \(loginRequest.userId)") | |
return Response(.Ok, contentType: "application/json; charset=utf8", body: loginResponse.toJSON().rawString()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment