Go REST API for upcoming European rocket launch data with authentication and location filtering.
⚠️ Development API Notice This project currently uses the ThespaceDevs development API (lldev.thespacedevs.com). Not intended for production use. For production deployments, switch to the production API endpoint and obtain a proper API key from ThespaceDevs.
# 1. Clone and setup
git clone git@github.com:r3morce/rleu-api.git
cd rleu-api
cp .env.example .env
# 2. Generate API key
uuidgen # Copy the output
# 3. Edit .env and add your key
RLEU_API_KEY=your-key-here
# 4. Run
go run ./cmd/server
# 5. Test (use your actual key)
curl -H "Authorization: Bearer YOUR_API_KEY" http://localhost:8080/launches- Go 1.16+ (download)
Create .env file:
RLEU_API_KEY=your-generated-uuid-here # Required for auth
DEBUG=false # Set to true to skip authEdit config/config.yaml for API settings:
api:
limit: 5 # Number of launches to fetch
server:
port: 8080 # Server port
european_pads:
enabled: true # Filter European launches only# Development (with hot reload)
go run ./cmd/server
# Production build
go build -o rleu-api ./cmd/server
./rleu-api
# Debug mode (no authentication)
DEBUG=true go run ./cmd/serverInclude API key in Authorization header:
curl -H "Authorization: Bearer YOUR_API_KEY" http://localhost:8080/launchesGET /launches - Get upcoming launches
- Returns 5 upcoming launches
- European filtering if enabled in config
- Requires authentication (unless DEBUG=true)
Response:
{
"count": 1,
"results": [{
"id": "...",
"name": "Falcon 9 | Starlink",
"net": "2025-11-22T23:41:00Z",
"status": { "name": "Go for Launch" }
}]
}DEBUG=true ./rleu-api
curl http://localhost:8080/launches # No auth neededDebug features:
- ✓ Authentication disabled
- ✓ API throttle monitoring
- ✓ Detailed logging
rleu-api/
├── cmd/server/main.go # HTTP server & auth
├── internal/launches/ # API client & models
├── config/ # Configuration
└── .env # Your secrets (git-ignored)
Deploy to Fly.io with automatic HTTPS and European hosting:
# 1. Install Fly CLI
curl -L https://fly.io/install.sh | sh
# 2. Login
fly auth login
# 3. Launch app (follow prompts)
fly launch
# 4. Set your API key as a secret
fly secrets set RLEU_API_KEY=your-generated-uuid-here
# 5. Deploy
fly deploy
# 6. Check status
fly status
# Your API will be available at: https://rleu-api.fly.devConfiguration:
- Region: Amsterdam (
ams) - European data center - Auto HTTPS with Let's Encrypt certificates
- Auto-scaling: scales to zero when idle (free tier friendly)
- Health checks on
/launchesendpoint
Update deployment:
fly deployView logs:
fly logsWith Docker Compose (recommended for local development):
# Start (reads .env file automatically)
docker-compose up
# Start in background
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose down
# Rebuild and start
docker-compose up --buildWith Docker directly:
# Build
docker build -t rleu-api .
# Run
docker run -p 8080:8080 -e RLEU_API_KEY=your-key-here rleu-api
# Run in debug mode
docker run -p 8080:8080 -e RLEU_API_KEY=your-key-here -e DEBUG=true rleu-apiTest:
curl -H "Authorization: Bearer your-key-here" http://localhost:8080/launches