#!/bin/bash echo "πŸ—ΊοΈ XML Sitemap Generator API" echo "==============================" echo "" # Check if Go is installed if ! command -v go &> /dev/null; then echo "❌ Error: Go is not installed" echo "Please install Go 1.21+ from https://golang.org/dl/" exit 1 fi echo "βœ… Go version: $(go version)" echo "" # Install dependencies echo "πŸ“¦ Installing dependencies..." go mod download if [ $? -ne 0 ]; then echo "❌ Failed to download dependencies" exit 1 fi echo "βœ… Dependencies installed" echo "" # Build the application echo "πŸ”¨ Building application..." go build -o sitemap-api . if [ $? -ne 0 ]; then echo "❌ Build failed" exit 1 fi echo "βœ… Build successful" echo "" # Run the application echo "πŸš€ Starting server..." echo "" echo "Server will start on http://localhost:8080" echo "Press Ctrl+C to stop" echo "" ./sitemap-api