Skip to content

DataStax-Examples/astradb-spring-rest

Repository files navigation

AstraDB Spring REST

30 minutes, Beginner, Start Building

Create a Spring application that reads data from DataStax Astra using a REST API.

image

Objectives

  • Demonstrate how to communicate with the AstraDB REST API using Spring.

How this works

Once the Astra credentials are provided, the necessary tables are created in the database. Then, you can run the app and view the output from the AstraDB REST API.

Get Started

To build and play with this app, follow the build instructions that are located here: https://github.com/DataStax-Examples/astradb-spring-rest

Running AstraDB Spring REST

Follow the instructions below to get started.

Prerequisites

Let's do some initial setup.

DataStax Astra

  1. Create a DataStax Astra account if you don't already have one: image

  2. On the home page. Locate the button Add Database image

  3. Pick free plan and a region close to you, click configure. image image

  4. Define a database name, keyspace name and credentials (Take note of the DB Password) image

  5. Your Astra DB will be ready when the status will change from Pending to Active 💥💥💥 image

  6. After your database is provisioned, head to the Connect screen and copy your connection information (we'll need this later!): image

Github

  1. Click Use this template at the top of the GitHub Repository: image

  2. Enter a repository name and click 'Create repository from template': image

  3. Clone the repository: image

🚀 Getting Started Paths:

Make sure you've completed the prerequisites before starting this step

Running on Gitpod

  1. Click the 'Open in Gitpod' link: Open in IDE

  2. Wait for your Gitpod workspace to start: image

  3. Set your Astra database details by running the gitpod setup script in the Gitpod terminal at the bottom of the screen:

./gitpod-setup.sh

image

  1. Run the app and view the output in the terminal:
./gradlew bootRun 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published