Skip to content

Commit

Permalink
extracted routing in an external library: daikon-core
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Coser committed Mar 13, 2020
1 parent 3d40960 commit 0410810
Show file tree
Hide file tree
Showing 34 changed files with 56 additions and 378 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compile("org.eclipse.jetty:jetty-server:9.4.26.v20200117")
compile("org.eclipse.jetty:jetty-servlet:9.4.26.v20200117")
compile("com.github.DaikonWeb:daikon-core:0.0.1")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.5.1")
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/daikon/BasicAuthentication.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package daikon

import daikon.RequestFlow.halt
import daikon.core.Request
import daikon.core.RequestFlow.halt
import daikon.core.Response
import org.eclipse.jetty.http.HttpHeader.AUTHORIZATION
import org.eclipse.jetty.http.HttpHeader.WWW_AUTHENTICATE
import java.nio.charset.StandardCharsets.UTF_8
Expand Down
7 changes: 0 additions & 7 deletions src/main/kotlin/daikon/Context.kt

This file was deleted.

77 changes: 0 additions & 77 deletions src/main/kotlin/daikon/DefaultRouteAction.kt

This file was deleted.

13 changes: 0 additions & 13 deletions src/main/kotlin/daikon/DummyRouteAction.kt

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/kotlin/daikon/HaltException.kt

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/kotlin/daikon/HttpRequest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package daikon

import daikon.core.Method
import daikon.core.PathParams
import daikon.core.Request
import javax.servlet.http.HttpServletRequest

class HttpRequest(private val request: HttpServletRequest) : Request {
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/daikon/HttpResponse.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package daikon

import daikon.core.Response
import java.io.StringWriter
import java.nio.charset.StandardCharsets.UTF_8
import javax.servlet.http.HttpServletResponse
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/daikon/HttpServer.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package daikon

import daikon.Method.*
import daikon.core.Method.*
import daikon.core.*
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.DefaultServlet
import org.eclipse.jetty.servlet.ServletContextHandler
Expand Down Expand Up @@ -163,7 +164,7 @@ class HttpServer(private val port: Int = 4545, initializeActions: HttpServer.()
}
fun after(path: String = "/*", action: (Request, Response) -> Unit): HttpServer {
afterActions.add(Route(ANY, joinPaths(path), DummyRouteAction(action)))
afterActions.add(Route(Method.ANY, joinPaths(path), DummyRouteAction(action)))
return this
}
Expand Down
89 changes: 0 additions & 89 deletions src/main/kotlin/daikon/HttpStatus.kt

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/kotlin/daikon/Method.kt

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/kotlin/daikon/PathParams.kt

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/kotlin/daikon/Request.kt

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/kotlin/daikon/RequestFlow.kt

This file was deleted.

12 changes: 0 additions & 12 deletions src/main/kotlin/daikon/Response.kt

This file was deleted.

18 changes: 0 additions & 18 deletions src/main/kotlin/daikon/Route.kt

This file was deleted.

5 changes: 0 additions & 5 deletions src/main/kotlin/daikon/RouteAction.kt

This file was deleted.

46 changes: 0 additions & 46 deletions src/main/kotlin/daikon/Routing.kt

This file was deleted.

Loading

0 comments on commit 0410810

Please sign in to comment.