CognxSafeTrack
fix(arch): HF inbound-only + seedDatabase export + DISABLE_WORKER + DISABLE_WHATSAPP_SEND
fe2f79f Download scripts/start-backend.sh from safetrack/edtech: direct link, hf CLI and curl.
- Browser
- Download file 998 Bytes
-
https://huggingface.co/spaces/safetrack/edtech/resolve/main/scripts/start-backend.sh
- Command line
-
hf download hf://spaces/safetrack/edtech/scripts/start-backend.sh
-
curl -L -o start-backend.sh https://huggingface.co/spaces/safetrack/edtech/resolve/main/scripts/start-backend.sh
998 Bytes
| set -ex | |
| echo "Running database migrations..." | |
| pnpm --filter @repo/database db:push | |
| # On Hugging Face (DISABLE_WORKER=true), only run the API. | |
| # The WhatsApp worker runs exclusively on Railway and calls graph.facebook.com from there. | |
| if [ "${DISABLE_WORKER}" != "true" ]; then | |
| echo "Starting WhatsApp Worker..." | |
| if [ -f "apps/whatsapp-worker/dist/src/index.js" ]; then | |
| node apps/whatsapp-worker/dist/src/index.js & | |
| elif [ -f "apps/whatsapp-worker/dist/index.js" ]; then | |
| node apps/whatsapp-worker/dist/index.js & | |
| else | |
| echo "WARNING: WhatsApp Worker build output missing — worker not started." | |
| fi | |
| else | |
| echo "DISABLE_WORKER=true — Skipping worker startup (HF inbound-only mode)." | |
| fi | |
| echo "Starting API..." | |
| if [ -f "apps/api/dist/src/index.js" ]; then | |
| exec node apps/api/dist/src/index.js | |
| elif [ -f "apps/api/dist/index.js" ]; then | |
| exec node apps/api/dist/index.js | |
| else | |
| echo "ERROR: API build output missing!" | |
| exit 1 | |
| fi | |