Files
learn-build-apps-copilot-agent/.github/steps/4-setup-django-rest-framework.md
T
2026-06-20 04:28:24 +03:00

1.1 KiB

Step 4: Wire API hosting for the multi-tier application

In this step, you will finalize API hosting for your multi-tier application:

  • Keep backend API on port 8000.
  • Build Codespaces-aware API URL behavior using $CODESPACE_NAME.
  • Validate endpoints with curl.

⌨️ Activity: Configure API base URL and host support

Static Badge

Let's configure the Node.js API for Codespaces and localhost.

- Backend runs on port 8000
- Build API base URL with $CODESPACE_NAME when available:
  https://$CODESPACE_NAME-8000.app.github.dev
- Keep localhost support when $CODESPACE_NAME is not set
- Verify /api/users and /api/activities with curl
  1. Commit and push your changes to build-octofit-app.

  2. Wait for Mona to validate and share the next step.

Having trouble? 🤷

Verify octofit-tracker/backend/src/server.ts includes:

  • CODESPACE_NAME
  • -8000.app.github.dev