mirror of
https://github.com/logseq/logseq.git
synced 2026-05-05 03:16:37 +00:00
add publish worker
This commit is contained in:
32
deps/publish/worker/scripts/dev_test.sh
vendored
Executable file
32
deps/publish/worker/scripts/dev_test.sh
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
BASE_URL=${BASE_URL:-"http://127.0.0.1:8787"}
|
||||
GRAPH_UUID=${GRAPH_UUID:-"00000000-0000-0000-0000-000000000000"}
|
||||
PAGE_UUID=${PAGE_UUID:-"00000000-0000-0000-0000-000000000001"}
|
||||
|
||||
META=$(cat <<JSON
|
||||
{"page-uuid":"${PAGE_UUID}","block-count":1,"schema-version":"0","publish/format":"transit","publish/compression":"none","publish/content-hash":"dev","publish/content-length":1,"publish/graph":"${GRAPH_UUID}","publish/created-at":0}
|
||||
JSON
|
||||
)
|
||||
|
||||
PAYLOAD="{}"
|
||||
|
||||
curl -sS -X POST "${BASE_URL}/pages" \
|
||||
-H "content-type: application/transit+json" \
|
||||
-H "x-publish-meta: ${META}" \
|
||||
--data-binary "${PAYLOAD}"
|
||||
|
||||
echo
|
||||
|
||||
curl -sS "${BASE_URL}/pages/${PAGE_UUID}"
|
||||
|
||||
echo
|
||||
|
||||
curl -sS "${BASE_URL}/pages/${PAGE_UUID}/transit"
|
||||
|
||||
echo
|
||||
|
||||
curl -sS "${BASE_URL}/pages"
|
||||
|
||||
echo
|
||||
Reference in New Issue
Block a user