diff --git a/src/crawlers/leetx.nim b/src/crawlers/leetx.nim index ab01cf0..b8a5fff 100644 --- a/src/crawlers/leetx.nim +++ b/src/crawlers/leetx.nim @@ -103,7 +103,6 @@ proc fetchLatest*() {.async.} = discard insert_torrent(torrent) proc startCrawl*() {.async.} = - echo "Doing it" while true: try: await fetchLatest() diff --git a/src/torrentinim.nim b/src/torrentinim.nim index 6405b9b..3b8bda1 100644 --- a/src/torrentinim.nim +++ b/src/torrentinim.nim @@ -2,6 +2,7 @@ import os import json import prologue import strutils +import strformat import prologue/middlewares/cors @@ -45,10 +46,14 @@ when isMainModule: resp jsonResponse(%results) var allowOrigins = getEnv("ALLOW_ORIGINS", "") - let settings = newSettings(debug = false, port = Port(getEnv("TORRENTINIM_PORT", "50123").parseInt())) + let port = getEnv("TORRENTINIM_PORT", "50123").parseInt() + let settings = newSettings(debug = false, port = Port(port)) var app = newApp(settings = settings) app.use(CorsMiddleware(allowOrigins = @[allowOrigins])) app.addRoute("/", hello) app.addRoute("/search", search) app.addRoute("/hot", hot) - app.run() \ No newline at end of file + + echo &"Torrentinim is running, bambino. http://localhost:{port}" + app.run() + \ No newline at end of file