- System requirements
- JDK 17
- Gradle
- Start the dev server.
gradle bootRun
You can use cURL or a tool like Postman to test the API.
You can log in as one of the seeded users with the following curl command:
curl --location --request POST 'localhost:8080/api/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "thomas",
"password": "123456"
}'Then you can use the token that comes back from the /login request to make an authenticated request to create a new blog post
curl --location --request POST 'localhost:8080/api/posts' \
--header 'x-access-token: your-token-here' \
--header 'Content-Type: application/json' \
--data-raw '{
"text": "This is some text for the blog post...",
"tags": ["travel", "hotel"]
}'- If you see
gradle bootRunget stuck with a message "80% EXECUTING", please check if there is a log message "Started BlogPostsApplication in *.** seconds". Your server is running is you see this log.