{"id":25762029,"url":"https://github.com/nielspeter/redis-rest-proxy","last_synced_at":"2026-05-01T03:35:02.415Z","repository":{"id":277031802,"uuid":"929979409","full_name":"nielspeter/redis-rest-proxy","owner":"nielspeter","description":"A RESTful proxy for Redis","archived":false,"fork":false,"pushed_at":"2025-02-13T19:42:44.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T07:40:08.792Z","etag":null,"topics":["proxy","redis","rest-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nielspeter.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-09T20:40:25.000Z","updated_at":"2025-02-13T19:42:48.000Z","dependencies_parsed_at":"2025-02-11T19:31:19.985Z","dependency_job_id":"4041869f-7cb6-4aa2-9cbe-6067f5a1511c","html_url":"https://github.com/nielspeter/redis-rest-proxy","commit_stats":null,"previous_names":["nielspeter/redis-rest-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nielspeter/redis-rest-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielspeter%2Fredis-rest-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielspeter%2Fredis-rest-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielspeter%2Fredis-rest-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielspeter%2Fredis-rest-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nielspeter","download_url":"https://codeload.github.com/nielspeter/redis-rest-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielspeter%2Fredis-rest-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32484352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["proxy","redis","rest-api"],"created_at":"2025-02-26T19:27:33.936Z","updated_at":"2026-05-01T03:35:02.389Z","avatar_url":"https://github.com/nielspeter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis REST Proxy\n\n[![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/nielspeter/redis-rest-proxy)\n[![Docker Image](https://img.shields.io/badge/Docker-Package-blue?logo=docker)](https://github.com/nielspeter/redis-rest-proxy/pkgs/container/redis-rest-proxy)\n\nRedis REST Proxy exposes Redis functionality via a RESTful HTTP API. Ideal for client running in a serverless or edge environments where TCP/IP may not be available.\n\n## Table of Contents\n\n- [Features](#features)\n- [Compatibility Notice](#compatibility-notice)\n- [Quick Start](#quick-start)\n  - [Docker](#docker)\n  - [Manual Installation](#manual-installation)\n- [Upstash Client Usage](#upstash-client-usage)\n- [REST API Usage](#rest-api-usage)\n  - [Health Check](#1-health-check)\n  - [Generic Command via URL Path](#2-generic-command-via-url-path)\n  - [Generic Command Using JSON Body](#3-generic-command-using-json-body)\n  - [Pipeline Batch Commands](#4-pipeline-batch-commands)\n  - [Multi-exec (Transaction) Batch Commands](#5-multi-exec-transaction-batch-commands)\n  - [Base64 Encoded Responses](#6-base64-encoded-responses)\n- [Contributing](#contributing)\n- [Issues](#issues)\n- [License](#license)\n\n## Features\n\n- **RESTful Interface:** Converts HTTP requests into Redis commands.\n- **Serverless Friendly:** Connects applications running in serverless environments to Redis.\n- **High Performance:** Built with Bun for fast and efficient operation.\n- **Upstash Redis client** compatible.\n\n## Compatibility Notice\n\nThis proxy is tested with the [Upstash Redis JavaScript Client](https://github.com/upstash/redis-js/tree/main) and aims to maintain basic compatibility with Upstash Redis services.\n\n**Supported**\n\n- Pipeline \u0026 multi-exec transactions\n- Base64 encoding/decoding\n- Basic Redis commands\n- Authentication via bearer token\n\n**Not Supported**\n\n- Upstash-specific extensions\n\n---\n\n## Quick Start\n\n### Docker\n\n```bash\ndocker pull ghcr.io/nielspeter/redis-rest-proxy:latest\ndocker run -p 3000:3000 \\\n  -e AUTH_TOKEN=\"MY_SUPER_SECRET_TOKEN\" \\\n  -e REDIS_HOST=\"your.redis.host\" \\\n  ghcr.io/nielspeter/redis-rest-proxy\n```\n\n### Manual Installation\n\n```bash\ngit clone https://github.com/nielspeter/redis-rest-proxy.git\ncd redis-rest-proxy\nbun install\nbun run start\n```\n\n---\n\n## Upstash Client Usage\n\n```typescript\nimport { Redis } from '@upstash/redis';\n\nconst redis = new Redis({\n  url: 'http://localhost:3000',\n  token: 'MY_SUPER_SECRET_TOKEN',\n});\n\n// Works like Upstash Redis!\nawait redis.set('key', 'value');\nconst result = await redis.get('key');\n```\n\n---\n\n## REST API Usage\n\n**Authorization:** Use the `Authorization` header with the value `Bearer YOUR_AUTH_TOKEN` to authenticate requests.\n\n**Command Parsing:** Commands can be provided via:\n\n- URL path segments (e.g., `/get/mykey`)\n- A JSON array in the request body (e.g., `[\"set\", \"mykey\", \"hello\"]`)\n\nAdditionally, URL query parameters (except `_token`) are appended as extra command arguments.\n\n**Response Encoding:** If the header `Upstash-Encoding` or `Encoding` is set to `base64`, string responses (except `\"OK\"`) will be encoded in Base64. The encoding is applied recursively to arrays and objects.\n\n## Example Usage with cURL\n\nBelow are some examples demonstrating how to use the REST API. In these examples, the server is assumed to be running at `http://localhost:3000` and the auth token is `MY_SUPER_SECRET_TOKEN`.\n\n### 1. Health Check\n\nCheck that the proxy is healthy and that Redis responds:\n\n```bash\ncurl -H \"Authorization: Bearer MY_SUPER_SECRET_TOKEN\" http://localhost:3000/health\n```\n\nExpected response:\n\n```json\n{\n  \"status\": \"healthy\",\n  \"redis\": \"PONG\"\n}\n```\n\n### 2. Generic Command via URL Path\n\nFor a simple command like PING, you can issue the command directly in the URL:\n\n```bash\ncurl -H \"Authorization: Bearer MY_SUPER_SECRET_TOKEN\" http://localhost:3000/set/mykey/hello\n```\n\nExpected Response:\n\n```json\n{\n  \"result\": \"Ok\"\n}\n```\n\n### 3. Generic Command Using JSON Body\n\nSend commands as a JSON array in the POST body. For example, to set a key:\n\n```bash\ncurl -X POST \\\n  -H \"Authorization: Bearer MY_SUPER_SECRET_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '[\"set\", \"mykey\", \"hello\"]' \\\n  http://localhost:3000\n```\n\nExpected Response:\n\n```json\n{\n  \"result\": \"OK\"\n}\n```\n\n### 4. Pipeline Batch Commands\n\nExecute multiple commands in one request using the /pipeline endpoint. For example, to set a key and then get its value:\n\n```bash\ncurl -X POST \\\n  -H \"Authorization: Bearer MY_SUPER_SECRET_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '[[\"set\", \"key1\", \"value1\"], [\"get\", \"key1\"]]' \\\n  http://localhost:3000/pipeline\n```\n\nExpected Response:\n\n```json\n[{ \"result\": \"OK\" }, { \"result\": \"value1\" }]\n```\n\n### 5. Multi‑exec (Transaction) Batch Commands\n\nRun commands transactionally with the /multi-exec endpoint. For example, to increment a counter and then get its value:\n\n```bash\ncurl -X POST \\\n  -H \"Authorization: Bearer MY_SUPER_SECRET_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '[[\"incr\", \"counter\"], [\"get\", \"counter\"]]' \\\n  http://localhost:3000/multi-exec\n```\n\nExpected Response:\n\n```json\n[{ \"result\": 1 }, { \"result\": \"1\" }]\n```\n\n### 6. Base64 Encoded Responses\n\nRequest Base64 encoding by adding the Encoding: base64 header. For example, to get a key’s value in Base64:\n\n```bash\ncurl -H \"Authorization: Bearer MY_SUPER_SECRET_TOKEN\" \\\n  -H \"Encoding: base64\" \\\n  http://localhost:3000/get/mykey\n```\n\nExpected Response:\n\n```json\n{\n  \"result\": \"aGVsbG8=\" // (Base64 for \"hello\", if that's the value)\n}\n```\n\n---\n\n## Contributing\n\nWe welcome contributions to the project! Please follow these steps to contribute:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bugfix.\n3. Make your changes and commit them with clear and concise messages.\n4. Push your changes to your fork.\n5. Submit a pull request to the main repository.\n\n## Issues\n\n[Report Issue](https://github.com/nielspeter/redis-rest-proxy/issues)\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnielspeter%2Fredis-rest-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnielspeter%2Fredis-rest-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnielspeter%2Fredis-rest-proxy/lists"}