aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJakob Odersky <jakob@driver.xyz>2018-10-11 14:19:28 -0700
committerJakob Odersky <jakob@driver.xyz>2018-10-12 13:13:17 -0700
commita43556851bf986b81351fc9f1ae5ba51bf21dc47 (patch)
treeb5863203cb94b510ec4e4c2c611dd15317cbd5b8 /README.md
parent03ed05c0fcb948237d66f032c4e530b2349404b9 (diff)
downloaddriver-core-master.tar.gz
driver-core-master.tar.bz2
driver-core-master.zip
Add an example to the README and a standalone application templateHEADv2.0.0-M5masterjo/example
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 25 insertions, 1 deletions
diff --git a/README.md b/README.md
index ec0050a..9edbfe1 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,31 @@ libraries used are:
## Example Usage
-*TODO*
+The following implements a simple key-value store that uses object
+storage ("buckets") when running in the cloud and a local filesystem
+when running on a development machine.
+```scala
+import xyz.driver.core.init
+
+object Main extends init.SimpleHttpApp {
+
+ lazy val fs = storage("data")
+
+ override def applicationRoute = path("data" / Segment) { key =>
+ post {
+ entity(as[Array[Byte]]) { value =>
+ complete(fs.uploadContent(key, value))
+ }
+ } ~ get {
+ rejectEmptyResponse{
+ complete(fs.content(key))
+ }
+ }
+ }
+
+}
+```
+See [this example project](documentation/example) for a more details.
## Building