my nimble package dir:
webapp
-src
-webapp.nim
-static
-index.html
-webapp.nimble
webapp.nimble
# Package
version = "0.1.0"
author = "Shawn Ye"
description = "This a webserver"
license = "MIT"
bin = @["webapp"]
srcDir = "src"
# Dependencies
requires "nim >= 0.13.0"
requires "jester >= 0.1.0"
webapp.nim
# a simple html server
import
jester, asyncdispatch, htmlgen
routes:
get "/":
const test = staticRead "static/index.html" #must const
resp test
echo "starting web server ..."
runForever()
That's true , it should change to "../static/index.html", but the desired created executable would be the same dir as static, then the orignal path is right.
How to compromise? Any suggestion?