No description
- HTML 83.5%
- JavaScript 16.5%
Remove leading slash from app_location path Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|---|---|---|
| .github/workflows | ||
| .vscode | ||
| public | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| server.js | ||
| server.log | ||
| staticwebapp.config.json | ||
Transfer Portal
Transfer Portal API server with Node.js/Express and Azure PostgreSQL.
Prerequisites
- Node.js 18+
- PostgreSQL database (Azure Database for PostgreSQL Flexible Server)
Environment Variables
Create a .env file:
PGHOST=<your-postgres-host>
PGPORT=5432
PGUSER=<your-username>
PGPASSWORD=<your-password>
PGDATABASE=transfer_portal
PORT=3000
Installation
npm install
Development
npm run dev
Server watches for file changes and auto-reloads.
Production
npm start
Database
The app automatically creates the requests table on startup. Connection uses SSL for Azure PostgreSQL.
API Endpoints
GET /api/requests?status=<received|in-review|approved|denied>- List requestsPOST /api/requests- Create new requestPATCH /api/requests/:id/status- Update request statusDELETE /api/requests/denied- Delete all denied requestsDELETE /api/requests/approved/old- Delete approved requests older than 7 days
Frontend
Static UI is served from public/ folder. The app proxies API calls to backend endpoints.