- Go to src/api/db/db.clj
- change password for your
- go to resources/database/helper.sql
- execute this script
lein run
lein uberjar
java -jar target/uberjar/api-0.1.0-SNAPSHOT-standalone.jar
GET /
curl -i -H 'Accept: application/json' http://localhost:3000/thing/
{"ok": "Welcome to clojure-twitter-api! 😁"}
GET /tweets/all
curl -i -H 'Accept: application/json' http://localhost:3000/tweets/all
[
{
"id": "aca7125c-8117-4d7a-8f69-a76aae0cb9e9",
"body": "test - 1",
"username": "@lucianobajr"
},
{
"id": "7bc42d2d-9956-437f-859b-4d9953519334",
"body": "test - 3",
"username": "@guiaguiasilva"
}
]
GET /tweets?username=
curl -i -H 'Accept: application/json' http://localhost:3000/tweets?username=
[
{
"id": "e525c863-cd37-4a5b-817b-927c990bda1e",
"body": "test - 3",
"username": "@guiaguiasilva"
}
]
POST /tweets
curl -i -H 'Accept: application/json' http://localhost:3000/tweets
{
"body": "test - 4",
"username" : "@guiaguiasilva"
}
{"status":201,"Created"}
DELETE /tweets?id=
curl -i -H 'Accept: application/json' http://localhost:3000/tweets?id=
[
{
"update-count": 1,
"id": ""
}
]