From 24a037ad1959adbc3f5d0fb9cc22ae84794d3a44 Mon Sep 17 00:00:00 2001 From: Constantine Molchanov Date: Wed, 25 Nov 2020 14:28:12 +0400 Subject: [PATCH] Get rid of annoying deprecation warnings (#164) * Get rid of annoying deprecation warnings Changed existsFile to fileExists and existsDir to dirExists. * Install packages during nimble develop --- .travis.yml | 2 +- karax/tools/static_server.nim | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e03ea9..2f26a5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,5 @@ before_script: - set -e - export PATH=$(pwd)/nim/bin:$(pwd):$PATH script: - - nimble develop + - nimble develop -y - nim c -r tests/tester.nim diff --git a/karax/tools/static_server.nim b/karax/tools/static_server.nim index 40375a9..5838777 100644 --- a/karax/tools/static_server.nim +++ b/karax/tools/static_server.nim @@ -33,7 +33,7 @@ proc sendStaticIfExists( result = Http200 let mimes = newMimetypes() for p in paths: - if existsFile(p): + if fileExists(p): var fp = getFilePermissions(p) if not fp.contains(fpOthersRead): @@ -107,7 +107,7 @@ proc handleFileRequest( let pathDir = path.splitFile.dir / "" if pathDir.startsWith(publicUrl): - if existsDir(path): + if dirExists(path): status = await sendStaticIfExists( req, @[path / "index.html", path / "index.htm"] @@ -167,4 +167,4 @@ proc serveStatic*() = waitFor server.serve(Port(8080), cb) when isMainModule: - serveStatic() \ No newline at end of file + serveStatic()