[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: Give port option to Sandbox
From: |
gnunet |
Subject: |
[libeufin] branch master updated: Give port option to Sandbox |
Date: |
Tue, 12 Jan 2021 17:18:07 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new dba0d57 Give port option to Sandbox
dba0d57 is described below
commit dba0d57e2902a55c50983c006637266aa4f8fbee
Author: MS <ms@taler.net>
AuthorDate: Tue Jan 12 17:18:03 2021 +0100
Give port option to Sandbox
---
sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 99f196b..c3a0d9b 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -61,6 +61,7 @@ import com.github.ajalt.clikt.core.subcommands
import com.github.ajalt.clikt.output.CliktHelpFormatter
import com.github.ajalt.clikt.parameters.options.default
import com.github.ajalt.clikt.parameters.options.option
+import com.github.ajalt.clikt.parameters.types.int
import execThrowableOrTerminate
import io.ktor.request.*
import tech.libeufin.sandbox.BankAccountTransactionsTable.amount
@@ -116,10 +117,11 @@ class Serve : CliktCommand("Run sandbox HTTP server") {
}
private val dbConnString by option().default(DEFAULT_DB_CONNECTION)
private val logLevel by option()
+ private val port by option().int().default(5000)
override fun run() {
LOGGER = LoggerFactory.getLogger("tech.libeufin.sandbox")
setLogLevel(logLevel)
- serverMain(dbConnString)
+ serverMain(dbConnString, port)
}
}
@@ -173,9 +175,9 @@ fun main(args: Array<String>) {
.main(args)
}
-fun serverMain(dbName: String) {
+fun serverMain(dbName: String, port: Int) {
execThrowableOrTerminate { dbCreateTables(dbName) }
- val server = embeddedServer(Netty, port = 5000) {
+ val server = embeddedServer(Netty, port = port) {
install(CallLogging) {
this.level = Level.DEBUG
this.logger = LOGGER
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: Give port option to Sandbox,
gnunet <=