mirror of
https://github.com/Open-Argon/http.ar.git
synced 2026-10-28 09:43:55 +00:00
fix static
This commit is contained in:
1 parent
1d48d074cc
commit
a54b21114e
2 files changed
+2
-1
No files matched your search
@@ -6,7 +6,7 @@ let templates = {}
|
||||
let templatesPath = path.join([program.cwd, "templates"])
|
||||
|
||||
let renderTemplate(document, values) = do
|
||||
if (path in templates && (not debug.inDebug)) return templates[document].render(values)
|
||||
if (document in templates && (not debug.inDebug)) return templates[document].render(values)
|
||||
let template = neon.template(path.join([templatesPath,document]))
|
||||
if (not debug.inDebug) templates[document] = template
|
||||
return template.render(values)
|
||||
@@ -1,4 +1,5 @@
|
||||
let static(root, path) = do
|
||||
if (root == "/") root = ""
|
||||
let middleware(req, res) = do
|
||||
if (req.method != "GET") return res.next()
|
||||
if (not req.path.startswith(root)) return res.next()
|
||||
|
||||
Reference in new issue
Block a user