File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/kotlin/infrastructure/api Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
package infrastructure.api
10
10
11
+ import io.ktor.serialization.kotlinx.json.json
11
12
import io.ktor.server.application.Application
12
13
import io.ktor.server.application.call
14
+ import io.ktor.server.application.install
13
15
import io.ktor.server.engine.embeddedServer
14
16
import io.ktor.server.netty.Netty
17
+ import io.ktor.server.plugins.contentnegotiation.ContentNegotiation
15
18
import io.ktor.server.response.respondText
16
19
import io.ktor.server.routing.delete
17
20
import io.ktor.server.routing.get
@@ -27,7 +30,12 @@ class APIController {
27
30
* Starts the http server to serve the client requests.
28
31
*/
29
32
fun start () {
30
- embeddedServer(Netty , port = 3000 , module = this ::dispatcher).start(wait = true )
33
+ embeddedServer(Netty , port = 3000 ) {
34
+ dispatcher(this )
35
+ install(ContentNegotiation ) {
36
+ json()
37
+ }
38
+ }.start(wait = true )
31
39
}
32
40
33
41
/* *
You can’t perform that action at this time.
0 commit comments