You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your .env file should contain the connection string you copied from Redis Cloud.
Your .env.docker file will look similar to .env, but should use the appropriate docker internal URLs. Here is
an example:
REDIS_URL="redis://redis:6379"
Next, spin up docker containers:
docker compose up -d
You should have a server running on https://localhost:<port> where the port is set in your .env file (default is 8000). You can test the following routes:
GET /api/todos - Gets all todos
GET /api/todos/:id - Gets a todo by ID
GET /api/todos?[name=<name>]&[status=<status>] - Search for todos by name and/or status
POST /api/todos - Create a todo with { "name": "Sample todo" }
PATCH /api/todos/:id - Update todo by ID with { "status": "todo|in progress|complete" }
DELETE /api/todos/:id - Delete a todo by ID
Running tests
There are some tests in the test/java/io/redis/todoapp directory that can be run with the following command:
./mvnw test
These tests setup and teardown on their own. You can modify them if you want to leave data in Redis.
Running locally outside docker
To run the development server outside of docker, first install: