- Clone the repository
git@github.com:datastaxdevs/spring-boot-astra-spring-data-cassandra.git
-
- Create an account in Astra DB for free https://astra.datastax.com/
-
- Create an Application token https://docs.datastax.com/en/astra-db-serverless/administration/manage-application-tokens.html
- Open
application.propoerties
and changedatastax.astra.token
with your token anddatastax.astra.endpoint
with the endpoint of your database
datastax.astra.token=<change_me>
datastax.astra.endpoint=<change_me>
- Start the application (first start could take up a few seconds as the table is created for you)
mvn spring-boot:run
- List your todos (or in your browser http://localhost:8080/tables/todos)
curl -X GET http://localhost:8080/collections/todos
curl -X GET http://localhost:8080/tables/todos
- Create a todo
curl -X POST http://localhost:8080/collections/todos \
-H "Content-Type: application/json" \
-d '{"title": "New Todo", "description": "Todo details", "completed": false}'
curl -X POST http://localhost:8080/tables/todos \
-H "Content-Type: application/json" \
-d '{"title": "New Todo", "description": "Todo details", "completed": false}'