- Clone the repository
[email protected]:datastaxdevs/spring-boot-astra-spring-data-cassandra.git
-
Create an account in Astra DB for free here
-
Create a Database ( documentation)
-
Create an Application token (documentation)
-
Get you Secure Connect bundle from Astra (documentation)
- Open
application.properties
and change those 2 properties:
# Replace with your token starting with AstraCS:...
spring.cassandra.password=<change_me>
# Replace with the path of your secure bundle
datastax.astra.secure-connect-bundle=<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/todos)
curl -X GET http://localhost:8080/todos
- Create a todo
curl -X POST http://localhost:8080/todos \
-H "Content-Type: application/json" \
-d '{"title": "New Todo", "description": "Todo details", "completed": false}'