This is a simple Go web server that serves ASCII art animations when accessed via curl.
When you curl the server endpoint, it returns frames of ASCII art in sequence with 0.1 second delays between each frame, creating a smooth animation effect. The animation loops continuously until you interrupt it with Ctrl+C. Each frame is stored as a separate text file in the frames/ directory.
- Go 1.25.3 or later (for local development)
- Docker (for containerized deployment)
- Clone this repository
- Navigate to the project directory
- Run the following commands:
# Download dependencies
go mod tidy
# Build the application
go build -o curl-live
# Run the application
./curl-liveThe server will start on port 8080.
- Build the Docker image:
docker build -t curl-live .- Run the container:
docker run -p 8080:8080 curl-liveOnce the server is running, test it with curl:
curl http://localhost:8080main.go- The main Go application filego.mod- Go module definitionDockerfile- Docker configuration for containerization.dockerignore- Files to exclude from Docker buildframes/- Directory containing the 10 ASCII art frame files
To create your own animation:
- Modify the text files in the
frames/directory - Each file should contain the ASCII art for one frame of your animation
- The server will automatically read and display all files in sequence in an infinite loop
To add more frames to your animation:
- Simply create additional text files in the
frames/directory with sequential numbers (11.txt, 12.txt, etc.) - No code changes are needed - the application automatically detects all files in the directory
- The animation will include your new frames in the sequence
The Go application uses the Gin web framework to serve HTTP requests. When a request is received:
- The server sets appropriate headers for streaming text content
- It enters an infinite loop that reads each frame file from the
frames/directory in numerical order - Each frame is sent to the client with a 0.1 second delay between frames
- ANSI escape sequences are used to clear the screen between frames for smooth animation
- The animation continues indefinitely until the client disconnects
This project is open source and available under the MIT License.