A simple web service built with Deno and Hono for handling CRUD operations on JSON data.
709
A simple web service built with Deno and Hono for handling CRUD operations on JSON data.
services:
serverjson:
image: banghasan/serverjson:main
container_name: serverjson
ports:
- "8000:8000"
environment:
- AUTH_HEADER=r4HaS1AbangHaSAN
volumes:
- ./data:/app/data
restart: unless-stopped
/json/json/:id?pretty=true query parameter to get pretty-printed JSON output
/json/<UUID>?pretty=trueFor all write operations, include the Authorization header (default):
Authorization: r4HaS1AbangHaSAN
/json/json/:id/json/:id/json/:idcurl -X POST http://localhost:8000/json \
-H "Content-Type: application/json" \
-H "Authorization: r4HaS1AbangHaSAN" \
-d '{
"title": "Example Item",
"content": "This is a sample content",
"author": "Test User"
}'
curl http://localhost:8000/json
curl http://localhost:8000/json/<UUID>
curl http://localhost:8000/json/<UUID>?pretty=true
curl -X PATCH http://localhost:8000/json/<UUID> \
-H "Content-Type: application/json" \
-H "Authorization: r4HaS1AbangHaSAN" \
-d '{
"content": "Updated content"
}'
curl -X PUT http://localhost:8000/json/<UUID> \
-H "Content-Type: application/json" \
-H "Authorization: r4HaS1AbangHaSAN" \
-d '{
"title": "New Title",
"content": "New content"
}'
curl -X DELETE http://localhost:8000/json/<UUID> \
-H "Authorization: r4HaS1AbangHaSAN"
The service automatically runs a scheduler at 00:00 (midnight) daily in the Asia/Jakarta timezone to remove files older than the configured number of days (default: 7 days).
data/<UUID>.jsoncreatedAt timestamp is automatically added to each stored itemContent type
Image
Digest
sha256:07c073613…
Size
73.9 MB
Last updated
11 months ago
docker pull banghasan/serverjson:main-36daeeb