Skip to content

Instantly share code, notes, and snippets.

@jhs
Created November 13, 2013 23:14
Show Gist options
  • Save jhs/7458253 to your computer and use it in GitHub Desktop.
Save jhs/7458253 to your computer and use it in GitHub Desktop.
-module(my_first_couchdb_plugin).
-export([handler/1]).
handler(Req) -> ok
, Bugs = couch_config:get("first", "enable_bugs", "false")
, {Code, Body} = case Bugs
of "false" -> ok
, {200, {[ {hello, <<"world">>} ]}}
; _ -> ok
, {500, {[ {error, <<"bugs">>} ]}}
end
, couch_httpd:send_json(Req, Code, Body)
.
-module(hello).
-export([test/0]).
test() ->
"Hi, I am a protoplugin".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment