Blog APIs
- Java 8
- Java EE 7
- WildFly Swarm
// TODO Swagger
curl localhost:8080/entriescurl localhost:8080/entries/:yyyy/:MM/:dd/:permalink$ curl -X POST -H "Content-Type: application/json" -d '{"title":"title1", "permalink":"permalink1", "content":"content1","state":"PUBLIC", "format":"MARKDOWN"}' localhost:8080/admin/entries -v$ curl -X PUT -H "Content-Type: application/json" -d '{"title":"updated-title", "content":"updated-content", "permalink":"updated-permalink", "state":"PUBLIC", "format":"HTML"}' localhost:8080/admin/entries/1 -v$ curl -X DELETE localhost:8080/admin/entries/1 -v$ curl -X GET http://localhost:8080/media$ curl -X GET http://localhost:8080/media/:uuid/:filename$ curl -X POST -F 'file=@some-media.jpg' http://localhost:8080/admin/media$ curl -X DELETE http://localhost:8080/admin/media/:uuid/:filename$ curl -X GET localhost:8080/configurations$ curl -X PUT -H "Content-Type: application/json" -d '{"blogName" : "updated blog name", "blogDescription" : "updated blog description", "publicity" : true}' localhost:8080/admin/configurations -vPut .env file under docker dir with copying from .env.template and fill out POSTGRES_USER, POSTGRES_PASSWORD.
Install Docker Compose and type the following command.
docker-compose -f docker/docker-compose.yml up -d./mvnw clean package./mvnw clean package docker:builddocker run -it -d \
--name morecat-db \
-e POSTGRES_USER=morecat -e POSTGRES_PASSWORD=morecat \
-v /tmp/pgdata/data:/var/lib/postgresql/data \
-p 5432:5432 \
emag/morecat-db:1.0.0docker run -it --rm \
--link morecat-db:db \
emag/morecat-db:1.0.0 \
sh -c 'exec psql -h "$DB_PORT_5432_TCP_ADDR" -p "$DB_PORT_5432_TCP_PORT" -U morecat'java \
-Dswarm.morecat.db.host=localhost -Dswarm.morecat.db.port=5432 \
-Dswarm.morecat.db.user=morecat -Dswarm.morecat.db.password=morecat \
-jar target/morecat-swarm.jar./mvnw clean verify \
-Dswarm.morecat.db.host=localhost -Dswarm.morecat.db.port=5432 \
-Dswarm.morecat.db.user=morecat -Dswarm.morecat.db.password=morecat