# Spring Boot Banner Generator — Setup & Usage ## Running the App ```bash mvn spring-boot:run ``` The app starts on `http://localhost:8080`. --- ## Web UI Open your browser and go to: ``` http://localhost:8080/banner ``` Upload an image, choose light or dark mode, and the colored HTML banner is rendered in the page. --- ## REST API ### Generate a Banner **Endpoint:** `POST /api/banner` **Content-Type:** `multipart/form-data` | Field | Type | Required | Description | |---------|---------|----------|------------------------------------| | `image` | file | yes | Image to convert (PNG, JPG, etc.) | | `dark` | boolean | no | Use dark color scheme (default: false) | **Curl example:** ```bash curl -X POST http://localhost:8080/api/banner \ -F "image=@./logo.png" \ -F "dark=false" ``` **Response (JSON):** ```json { "ansi": "${AnsiColor.RED}@@@@...", "html": "@..." } ``` --- ## Which Output to Use ### `ansi` — Colored terminal banner for Spring Boot apps The `ansi` field contains Spring Boot's `${AnsiColor.X}` syntax. Paste it into `src/main/resources/banner.txt` in **any Spring Boot project** and it will print in color when the app starts. **Extract and save directly:** ```bash curl -s -X POST http://localhost:8080/api/banner \ -F "image=@./logo.png" \ -F "dark=false" \ | python -c "import sys,json; print(json.load(sys.stdin)['ansi'])" \ > /path/to/your-spring-app/src/main/resources/banner.txt ``` Then start your Spring Boot app — the banner prints in color in the terminal. ### `html` — Colored banner for web pages The `html` field contains inline `` tags. Drop it inside a `
` tag in any HTML page:

```html
  
``` --- ## Swagger UI Interactive API docs are available at: ``` http://localhost:8080/swagger-ui.html ``` Use it to explore and test the `/api/banner` endpoint directly from the browser — upload a file, toggle dark mode, and see the live JSON response. The raw OpenAPI spec (JSON) is at: ``` http://localhost:8080/v2/api-docs ```