diff --git a/README.md b/README.md index 0a60b1b..dbce5c4 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ beyond this then I'd definitely recommend checking out [KaMPKit](https://github. ### Building You need to use Android Studio Canary version (**note: Java 11 is now the minimum version required**). Have tested with XCode v11 and v12. When opening iOS/watchOS/macOS projects remember to open `.xcworkspace` file (and not `.xcodeproj` one). To exercise web client run `./gradlew :web:browserDevelopmentRun`. +To run backend you can either run `./gradlew :backend:run` or run `Server.kt` directly from Android Studio. +After doing that you should then for example be able to open `http://localhost:9090/astros_local.json` in a browser. **UPDATE**: now also works in stable version of Android Studio. diff --git a/backend/src/main/kotlin/Server.kt b/backend/src/main/kotlin/Server.kt index 4d777e8..bbc8573 100644 --- a/backend/src/main/kotlin/Server.kt +++ b/backend/src/main/kotlin/Server.kt @@ -10,9 +10,6 @@ import com.surrus.common.remote.Assignment import io.ktor.application.call import io.ktor.application.install import io.ktor.features.ContentNegotiation -import io.ktor.http.ContentType -import io.ktor.http.content.resources -import io.ktor.http.content.static fun main() { @@ -26,17 +23,6 @@ fun main() { routing { - get("/") { - call.respondText( - this::class.java.classLoader.getResource("index.html")!!.readText(), - ContentType.Text.Html - ) - } - - static("/") { - resources("") - } - get("/astros.json") { val result = peopleInSpaceApi.fetchPeople() call.respond(result)