#!/bin/bash echo "Testing Tender Management API Server..." # Check if MongoDB is running if ! pgrep -x "mongod" > /dev/null; then echo "Warning: MongoDB is not running. Starting server may fail." echo "To start MongoDB: sudo systemctl start mongod" fi # Build the server echo "Building server..." go build -o bin/web ./cmd/web if [ $? -ne 0 ]; then echo "Build failed!" exit 1 fi echo "Build successful!" # Test the health endpoint (if server starts) echo "Testing health endpoint..." timeout 5s curl -s http://localhost:8081/health || echo "Server not responding (expected if MongoDB is not running)" echo "Test completed!"