I want to use jester and create web sites. However it can't read files javascript and css.
In jester, public folder is default static folder. https://github.com/dom96/jester
So, I create nim and tmpl files:
./
- [public]
- [css]
- style.css
- [js]
- main.js
- main.nim (jester's router)
- main.exe (compiled main.nim)
- index.tmpl (HTML file)
main.nim
import jester
include "index.tmpl"
routes:
get "/":
resp(indexTmpl())
index.tmpl
#? stdtmpl | standard
# proc indexTmpl(): string =
# result = ""
<html lang="ja">
<head>
<title>test</title>
<meta charset="utf-8">
<link rel="stylesheet" href="./css/style.css">
<script src="./js/main.js"></script>
</head>
<body class="black">
test
</body>
</html>
After compile and access http://localhost:5000/public/js/main.js , jester returned 400 bad request. I got the same result even if I access http://localhost:5000/js/main.js .
What am I doing wrong? If you know, please tell me how to resolve.
Thank you.
You have to remove the dot in the path.
./css/style.css => /css/style.css
Thank you for your answer!
I try to remove the dot in the path after fixed!
Thank you!
Thank you for your reply! And thank you for considering the fix!
I am looking forward to it!!
Thank you!