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
This commit is contained in:
Constantine Molchanov 2020-11-25 14:28:12 +04:00 • committed by GitHub
commit 24a037ad19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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()
serveStatic()