commit 27c8b928908f7065d13c420cd87f8a3b76cf4848
parent 205893026200ffd675a94a74d56af7dbe1da2fd6
Author: Joris Vink <joris@coders.se>
Date: Tue, 3 Jul 2018 14:08:46 +0200
improve the assets docs
Diffstat:
applications/building.md | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/applications/building.md b/applications/building.md
@@ -4,7 +4,7 @@ Kore provides a flexible way of building your applications through the **conf/bu
This file contains build flavors that dictate CFLAGS and LDFLAGS.
-Flavors can be switched using _ kodev flavor_:
+Flavors can be switched using the **flavor** command:
```
$ kodev flavor osx
@@ -20,6 +20,26 @@ Kore will automatically build any source files found under the **src** directory
By default the build tool will automatically convert files found under **assets** into C files and compile them into your code allowing you to access these directly.
+Each asset gets its own page handler as well that can be easily added to the configuration, reducing the work you have to do to configure static assets.
+Additionally the assets also get an ETag that is automatically included in the response and Kore will honor if-none-match for these assets and send
+a 304 if they were not modified.
+
+The example below configures / to serve the static asset index.html.
+
+```
+domain * {
+ static / asset_serve_index_html
+}
+```
+
+You may specify media types for these static assets in **conf/build.conf**.
+
+```
+mime_add=jpg:imge/jpg
+mime_add=css:text/css; charset=utf-8
+mime_add=html:text/html; charset=utf-8
+```
+
### Single binaries
Kore will normally produce a single dynamic library \(DSO\) file that contains your application logic. This DSO file is then loaded at run-time by the main Kore binary as instructed by your configuration file.