gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libeufin] branch master updated: calling the ktor client


From: gnunet
Subject: [GNUnet-SVN] [libeufin] branch master updated: calling the ktor client
Date: Tue, 08 Oct 2019 15:35:25 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new d27d961  calling the ktor client
d27d961 is described below

commit d27d961bc38cbbfb81f526a06554c1c6c20f3c3c
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Oct 8 15:35:17 2019 +0200

    calling the ktor client
---
 nexus/build.gradle            |  2 +-
 nexus/src/main/kotlin/DB.kt   |  5 +++++
 nexus/src/main/kotlin/Main.kt | 21 ++++++++++++++++-----
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/nexus/build.gradle b/nexus/build.gradle
index d58414c..045c161 100644
--- a/nexus/build.gradle
+++ b/nexus/build.gradle
@@ -4,12 +4,12 @@ application {
 
 dependencies {
     implementation project(":sandbox")
+    compile "io.ktor:ktor-client-apache:1.2.4"
 }
 
 jar {
     manifest {
         attributes "Main-Class": "tech.libeufin.nexus.MainKt"
-
     }
 
     from {
diff --git a/nexus/src/main/kotlin/DB.kt b/nexus/src/main/kotlin/DB.kt
new file mode 100644
index 0000000..63d1e6b
--- /dev/null
+++ b/nexus/src/main/kotlin/DB.kt
@@ -0,0 +1,5 @@
+package tech.libeufin.nexus
+
+import org.jetbrains.exposed.dao.*
+import org.jetbrains.exposed.sql.*
+import org.jetbrains.exposed.sql.transactions.transaction
\ No newline at end of file
diff --git a/nexus/src/main/kotlin/Main.kt b/nexus/src/main/kotlin/Main.kt
index 00ca3b5..9566670 100644
--- a/nexus/src/main/kotlin/Main.kt
+++ b/nexus/src/main/kotlin/Main.kt
@@ -20,19 +20,21 @@
 package tech.libeufin.nexus
 
 import io.ktor.application.call
-import io.ktor.application.install
-import io.ktor.features.CallLogging
-import io.ktor.features.ContentNegotiation
-import io.ktor.gson.gson
+import io.ktor.client.*
+import io.ktor.client.features.ServerResponseException
+import io.ktor.client.request.get
 import io.ktor.response.respondText
 import io.ktor.routing.get
 import io.ktor.routing.post
 import io.ktor.routing.routing
 import io.ktor.server.engine.embeddedServer
 import io.ktor.server.netty.Netty
-import java.text.DateFormat
+import tech.libeufin.sandbox.getLogger
 
 fun main() {
+
+    val logger = getLogger()
+
     val server = embeddedServer(Netty, port = 5001) {
 
         routing {
@@ -42,11 +44,20 @@ fun main() {
             }
 
             post("/nexus") {
+                val client = HttpClient()
+                val content = try {
+                    client.get<ByteArray>(
+                        "https://ebicstest1.libeufin.tech/";
+                    )
+                } catch (e: ServerResponseException) {
+                    logger.info("Request ended bad.")
+                }
                 call.respondText("Not implemented!\n")
                 return@post
             }
 
         }
     }
+
     server.start(wait = true)
 }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]