npm install
In one terminal, start the web server in watch mode:
npm run watch
In another terminal make some requests to the /micropub
endpoint. You could also use any other HTTP client to make requests, for example Postman.
curl "${HOST}:3001/micropub" \
-d h=entry \
-d "content=Hello World" \
-H "Accept: application/json" | jq
curl "${HOST}:3001/micropub" \
-d h=entry \
-d "content=Hello World" \
-H "Accept: application/json" \
-H "Authorization: Bearer invalid-token" | jq
Obtain a valid access token using a micropub client, for example Quill or Micropublish.
Create an h-entry representing a note.
The content
of an h-entry
could be either a string...
curl "${HOST}:3001/micropub" \
-d h=entry \
-d "content=Hello World" \
-H "Accept: application/json" \
-H "Authorization: Bearer $(cat secrets/token-endpoint-response.json | jq .access_token)" | jq
...or a JSON object with keys value
and html
.
curl "${HOST}:3001/micropub" \
-d h=entry \
-d "content={ \"value\": \"Hello World\", \"html\": \"<b>Hello</b> World\" }" \
-d "published=1985-04-12T23:20:50.52Z" \
-H "Accept: application/json" \
-H "Authorization: Bearer $(cat secrets/token-endpoint-response.json | jq .access_token)" | jq
Create an h-entry
representing a like.
curl "${HOST}:3001/micropub" \
-d h=entry \
-d "like-of=http://othersite.example.com/permalink47" \
-H "Accept: application/json" \
-H "Authorization: Bearer $(cat secrets/token-endpoint-response.json | jq .access_token)" | jq
Create an h-entry
representing a repost.
curl "${HOST}:3001/micropub" \
-d h=entry \
-d "repost-of=https://example.com/post" \
-H "Accept: application/json" \
-H "Authorization: Bearer $(cat secrets/token-endpoint-response.json | jq .access_token)" | jq
npm run test
Deploy to Google Cloud Platform.
npm run deploy