26fd628be229f54f5376a0a8addc32fe79fc34e7a8941ecfe488a7323a47924e.tri (817B)
1 !import prelude * 2 !import io * 3 !import arboricx_server * 4 !export * 5 6 -- Arboricx HTTP registry server demo. 7 -- Run with --allow-write /tmp/store --allow-read /tmp/store 8 -- 9 -- Endpoints: 10 -- GET /_arboricx/package/:name/:version -> exact release record 11 -- GET /_arboricx/health -> "OK" 12 -- POST /_arboricx/bundle -> upload bundle, returns hash 13 -- GET /_arboricx/bundle/hash/:h -> download bundle by hash 14 -- 15 -- Example usage: 16 -- curl http://localhost:9050/_arboricx/health 17 -- curl -X POST --data-binary @mybundle.arboricx http://localhost:9050/_arboricx/bundle 18 -- curl http://localhost:9050/_arboricx/bundle/hash/<hash> 19 20 main = io (do bind 21 putStrLn "Starting Arboricx server on 127.0.0.1:9050" 22 do onOk_ 23 ensureStore "/tmp/store" 24 arboricxServer "/tmp/store" "127.0.0.1" 9050)