Skip to content

Commit

Permalink
FEATURE : Implemented Hypertopic service at URI "/user/ID" (see Hyper…
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrihard committed Jun 14, 2018
1 parent c27d216 commit 82572d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rewrites.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"endkey": [":corpus", {}]
}
},
{
"from": "user/:user",
"to": "_view/user",
"query": {
"startkey": [":user"],
"endkey": [":user", {}]
}
},
{
"from": "included/*",
"to": "*"
Expand Down
9 changes: 9 additions & 0 deletions views/user/map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function(o) {
if (o.viewpoint_name) {
emit(["open-access"], {viewpoint:{id:o._id, name:o.viewpoint_name}, _id:o._id});
}

else if (o.corpus_name) {
emit(["open-access"], {corpus:{id:o._id, name:o.corpus_name}});
}
}

0 comments on commit 82572d0

Please sign in to comment.