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:
parent
40daae64e3
commit
24a037ad19
2 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue