|
@@ -6,11 +6,7 @@
|
|
|
-export([start/2, stop/1, init/1]).
|
|
|
|
|
|
q(Key) -> q(Key, []).
|
|
|
-q(Key, Default) ->
|
|
|
- case get(Key) of
|
|
|
- undefined -> Default;
|
|
|
- Value -> Value
|
|
|
- end.
|
|
|
+q(Key, Def) -> case get(Key) of undefined -> Def; Val -> Val end.
|
|
|
|
|
|
qc(Key) -> CX = get(context), qc(Key,CX#cx.req).
|
|
|
qc(Key,Req) -> proplists:get_value(nitro:to_binary(Key),cowboy_req:parse_qs(Req)).
|