#!/bin/bash

APP_MODULE='ows_text_campaigns.api.asgi:app'

# Set default values only if not already set in the environment
export UVICORN_HOST="${UVICORN_HOST:-0.0.0.0}"
export UVICORN_PORT="${UVICORN_PORT:-8080}"

DD_TRACE_BINARY=$(whereis ddtrace-run | cut -d ' ' -f 2)

# DataDog modules
export DD_TRACE_SNOWFLAKE_ENABLED=true

if [ -x ${DD_TRACE_BINARY} ]; then
    ${DD_TRACE_BINARY} uvicorn ${APP_MODULE}
else
    uvicorn ${APP_MODULE}
fi
