Static Files
When serving a directory, files that do not end in .nubo are served as static files.
nubo serve appExample:
app/ index.nubo style.css logo.pngRoutes:
| File | URL | Behavior |
|---|---|---|
index.nubo | / | Executed by Nubo. |
style.css | /style.css | Served as a static file. |
logo.png | /logo.png | Served as a static file. |
Static Files Are Not Executed
Section titled “Static Files Are Not Executed”Only .nubo files are executable.
app/data.jsonThe file above is served directly.
Static Fallback
Section titled “Static Fallback”If no route matches, Nubo tries to serve a built-in static file.
If that also fails, the request becomes a 404 Not Found.
Example HTML Page
Section titled “Example HTML Page”import response from "@server/response"
response.write("<!doctype html>") // the doctype part should be written as string // because Nubo only supports simple html tagsresponse.write(<html> <head> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>Hello</h1> </body></html>)Do not use <style> tags, because the parser may fail to parse nubo code between {}.
Only use style if really needed, and with <style>{content}</style>, and make content the
css content in string.