Skip to content

mioi/whimsy-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whimsy-api

Tests Go Version

A simple Go API server that provides random names of plants, animals, and colors. Perfect for generating whimsical names and data for your projects.

Endpoints

  • GET /plants - Get all plants
  • GET /animals - Get all animals
  • GET /colors - Get all colors
  • GET /names - Get all categories combined
  • GET /plants/random?count=5 - Get random plants
  • GET /animals/random?count=5 - Get random animals
  • GET /colors/random?count=5 - Get random colors
  • GET /names/random?count=10&parts=2 - Generate random names
  • GET /health - Health check

Local Development

go run main.go

Testing

go test ./...

Deploy to Google Cloud Run

  1. Build and push the Docker image:
gcloud builds submit --tag gcr.io/YOUR_PROJECT_ID/whimsy-api
  1. Deploy to Cloud Run:
gcloud run deploy whimsy-api \
  --image gcr.io/YOUR_PROJECT_ID/whimsy-api \
  --platform managed \
  --region us-central1 \
  --allow-unauthenticated

Replace YOUR_PROJECT_ID with your actual Google Cloud project ID.

About

A small API server designed to give you random names of colors, plants, and animals.

Resources

License

Stars

Watchers

Forks

Packages

No packages published