diff options
author | polwex <polwex@sortug.com> | 2025-09-11 01:48:14 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-09-11 01:48:14 +0700 |
commit | b1d68ac307ed87d63e83820cbdf843fff0fd9f7f (patch) | |
tree | d6a684a70a80509e68ff667b842aa4e4c091906f /desk/lib/shim.hoon |
init
Diffstat (limited to 'desk/lib/shim.hoon')
-rw-r--r-- | desk/lib/shim.hoon | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/desk/lib/shim.hoon b/desk/lib/shim.hoon new file mode 100644 index 0000000..be95b70 --- /dev/null +++ b/desk/lib/shim.hoon @@ -0,0 +1,23 @@ +/- sur=nostr +/+ js=json-nostr +/= web /web/router +|% + +++ handle + |= [eyre-id=@ta req=inbound-request:eyre] + ^- (unit [url=@ event=event:sur]) + ?~ body.request.req ~ + =/ jstring q.u.body.request.req + =/ ures (de:json:html jstring) + ?~ ures ~ + (msg:de:js u.ures) +++ send + |= [desk=@tas =req:shim:sur] ^- card:agent:gall + =/ req-body (req:en:js req) + =/ headers :~ + [key='content-type' value='application/json'] + == + =/ =request:http [%'POST' url:shim:sur headers `(json-body:web req-body)] + =/ pat /shim + [%pass (weld /ws pat) %arvo %k %fard desk %fetch %noun !>(request)] +-- |