{"id":16198520,"url":"https://github.com/colinodell/static-response-server","last_synced_at":"2026-05-15T18:02:37.242Z","repository":{"id":57635905,"uuid":"427034327","full_name":"colinodell/static-response-server","owner":"colinodell","description":"Super tiny HTTP server that always returns the same response","archived":false,"fork":false,"pushed_at":"2021-11-12T14:42:45.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T17:33:50.094Z","etag":null,"topics":["docker","go","golang","http","http-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colinodell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-11T14:39:53.000Z","updated_at":"2024-09-10T10:35:05.000Z","dependencies_parsed_at":"2022-09-26T20:21:23.054Z","dependency_job_id":null,"html_url":"https://github.com/colinodell/static-response-server","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/colinodell/static-response-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fstatic-response-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fstatic-response-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fstatic-response-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fstatic-response-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colinodell","download_url":"https://codeload.github.com/colinodell/static-response-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fstatic-response-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","go","golang","http","http-server"],"created_at":"2024-10-10T09:14:03.506Z","updated_at":"2026-05-15T18:02:37.227Z","avatar_url":"https://github.com/colinodell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# static-response-server\n\n[![GitHub](https://img.shields.io/github/license/colinodell/static-response-server?style=flat-square)](https://github.com/colinodell/static-response-server/blob/main/LICENSE)\n[![Docker Image Size (latest)](https://img.shields.io/docker/image-size/colinodell/static-response-server?style=flat-square)](https://hub.docker.com/repository/docker/colinodell/static-response-server)\n[![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/colinodell/static-response-server?style=flat-square)](https://pkg.go.dev/github.com/colinodell/static-response-server)\n\nSuper tiny HTTP server that always returns the same response.\n\n## Purpose\n\nAfter decommissioning a service, you may want to keep _something_ online and responding to HTTP requests letting users\nknow the service no longer exists. This is especially useful if legacy code is still hitting an API endpoint and completely\ntaking that offline might break consumers.\n\nInstead of spinning up a full blown HTTP server like nginx to handle this, you can instead use this super tiny, statically-compiled\nGolang-based Docker image which uses as few resources as possible.\n\n## Installation\n\n### Docker\n\nThe easiest way to use this server is via Docker:\n\n```bash\ndocker run -d -p 80:8080 colinodell/static-response-server --code=404 --body=\"Not Found\" --headers=\"Content-Type: text/plain\" -v\n```\n\nOr with environment variables:\n\n```bash\ndocker run -d -p 80:8080 -e HTTP_CODE=404 -e HTTP_BODY=\"Not Found\" -e HTTP_HEADERS=\"Content-Type: text/plain\" -e HTTP_VERBOSE=1 colinodell/static-response-server\n```\n\nUsing Docker-Compose? We've got that covered too!\n\n```yaml\nversion: '3'\nservices:\n  static-response-server:\n    image: colinodell/static-response-server\n    ports:\n      - \"80:8080\"\n    environment:\n      - HTTP_CODE=404\n      - HTTP_BODY=\"Not Found\"\n      - HTTP_HEADERS=\"Content-Type: text/plain\"\n      - HTTP_VERBOSE=1\n```\n\n_(Consider using a reverse proxy like [Traefik](https://github.com/traefik/traefik) to secure the requests with HTTPS.)_\n\n### Build From Source\n\nSimply clone this project and run `go build` to build the binary.\n\n## Configuration\n\nThe server can be configured via command line flags or environment variables:\n\n| Flag                | Environment Variable | Default | Description                                                        |\n|---------------------|----------------------|---------|--------------------------------------------------------------------|\n| `--port` or `-p`    | `HTTP_PORT`          | `8080`  | Port to listen on                                                  |\n| `--code`            | `HTTP_CODE`          | `200`   | HTTP status code to return                                         |\n| `--body`            | `HTTP_BODY`          |         | HTTP body to return                                                |\n| `--headers`         | `HTTP_HEADERS`       |         | HTTP headers to return (multiple headers separated by pipes (`\\|`) |\n| `--verbose` or `-v` | `VERBOSE`            | (off)   | Print verbose output                                               |\n\n```\n$ ./static-response-server --help\n\nusage: static-response-server [\u003cflags\u003e]\n\n    Flags:\n    --help           Show context-sensitive help (also try --help-long and --help-man).\n    -p, --port=8080  Port to listen on\n    --headers=\"\"     Headers to add to the response\n    --code=200       HTTP status code to return\n    --body=\"\"        Body to return\n    -v, --verbose    Verbose logging\n```\n\n## Examples\n\n### Returning a 404\n\n```bash\n./static-response-server --body \"This service no longer exists\" --code 404\n```\n\n### Returning a 404 (using environment variables)\n\n```bash\nHTTP_BODY=\"This service no longer exists\" HTTP_CODE=404 ./static-response-server\n```\n\n### Redirecting all traffic to a different URL\n\n```bash\n./static-response-server --body \"Moved Permanently\" --code 301 --headers \"Location: https://www.google.com\"\n```\n\n### Pretending your API still accepts POST requests\n\n```bash\n./static-response-server --code 201\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinodell%2Fstatic-response-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinodell%2Fstatic-response-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinodell%2Fstatic-response-server/lists"}