#!/bin/bash # Test Swagger Documentation Script echo "🚀 Starting Tender Management API Server with Swagger Documentation..." echo "" # Build the application echo "📦 Building application..." make build if [ $? -ne 0 ]; then echo "❌ Build failed!" exit 1 fi echo "" echo "✅ Build successful!" echo "" # Start the server in background echo "🌐 Starting server..." ./bin/web & SERVER_PID=$! # Wait for server to start echo "⏳ Waiting for server to start..." sleep 3 # Check if server is running if curl -s http://localhost:8081/health > /dev/null; then echo "✅ Server is running!" echo "" echo "📚 Swagger Documentation is available at:" echo " 🌐 http://localhost:8081/swagger/index.html" echo "" echo "🔍 Health Check endpoint:" echo " 🌐 http://localhost:8081/health" echo "" echo "📋 Available API endpoints:" echo " 🔐 Authentication:" echo " POST /api/customers/login" echo " POST /api/customers/refresh-token" echo " 👤 Customer Profile:" echo " GET /api/customers/profile" echo " PUT /api/customers/profile" echo " PUT /api/customers/change-password" echo " 📱 Device Management:" echo " POST /api/customers/device-token" echo " DELETE /api/customers/device-token" echo " 👥 Admin Operations:" echo " POST /api/admin/customers/register" echo " GET /api/admin/customers" echo " GET /api/admin/customers/{id}" echo " PUT /api/admin/customers/{id}/status" echo "" echo "🛑 To stop the server, press Ctrl+C or run: kill $SERVER_PID" echo "" # Keep the script running wait $SERVER_PID else echo "❌ Server failed to start!" kill $SERVER_PID 2>/dev/null exit 1 fi