Packaging: Fully static Haskell builds and webapp
This commit is contained in:
23
tricu-apps/arboricxServer.tri
Normal file
23
tricu-apps/arboricxServer.tri
Normal file
@@ -0,0 +1,23 @@
|
||||
!import "../lib/io.tri" !Local
|
||||
!import "../lib/arboricx/server.tri" !Local
|
||||
|
||||
-- Arboricx HTTP registry server.
|
||||
-- Run with --allow-write ./store --allow-read ./store
|
||||
--
|
||||
-- Endpoints:
|
||||
-- GET / -> HTML landing page
|
||||
-- GET /_arboricx/health -> "OK"
|
||||
-- POST /_arboricx/bundle -> upload bundle, returns hash
|
||||
-- GET /_arboricx/bundle/hash/:h -> download bundle by hash
|
||||
--
|
||||
-- Example usage:
|
||||
-- curl http://localhost:8080/
|
||||
-- curl http://localhost:8080/_arboricx/health
|
||||
-- curl -X POST --data-binary @mybundle.arboricx http://localhost:8080/_arboricx/bundles
|
||||
-- curl http://localhost:8080/_arboricx/bundle/hash/<hash>
|
||||
|
||||
main = io (thenIO
|
||||
(putStrLn "Starting Arboricx server on 0.0.0.0:8080")
|
||||
(thenIO
|
||||
(void (ensureStore "./store"))
|
||||
(arboricxServer "./store" "0.0.0.0" 8080)))
|
||||
Reference in New Issue
Block a user