Files

20 lines
684 B
Bash
Executable File

#!/usr/bin/env bash
# Starts the application, killing any previous instance first.
#
# Usage:
# OPENAI_API_KEY=sk-... ./scripts/run.sh
# CHAT_PROVIDER=ollama OLLAMA_BASE_URL=http://localhost:11434 ./scripts/run.sh
#
# Then, in another shell:
# curl 'http://localhost:8080/api/chat?message=What+is+a+ChatClient?'
# curl 'http://localhost:8080/api/chat/as?voice=pirate&message=Where+is+my+jar+cached'
# curl -N 'http://localhost:8080/api/chat/stream?message=Stream+this'
set -eu
cd "$(dirname "$0")/.."
for p in $(ps -eo pid,cmd | grep '[G]ettingStartedApplication' | awk '{print $1}'); do
kill -9 "$p"
done
mvn -q -o org.springframework.boot:spring-boot-maven-plugin:run