{"id":17696326,"url":"https://github.com/erisa/redis-exposer","last_synced_at":"2025-05-13T04:53:33.047Z","repository":{"id":43063108,"uuid":"470326844","full_name":"Erisa/redis-exposer","owner":"Erisa","description":"Serve read-only Redis data over a HTTP API with auth","archived":false,"fork":false,"pushed_at":"2024-11-27T11:14:01.000Z","size":241,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T04:53:26.636Z","etag":null,"topics":["api","express","redis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Erisa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"Erisa"}},"created_at":"2022-03-15T20:47:49.000Z","updated_at":"2025-04-15T15:12:48.000Z","dependencies_parsed_at":"2024-03-29T11:26:44.302Z","dependency_job_id":"a04db091-d572-4525-a423-0c1715d70686","html_url":"https://github.com/Erisa/redis-exposer","commit_stats":{"total_commits":30,"total_committers":4,"mean_commits":7.5,"dds":0.4,"last_synced_commit":"e2bd1095b3868a9d0b05508c512957198d9bf7bd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erisa%2Fredis-exposer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erisa%2Fredis-exposer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erisa%2Fredis-exposer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erisa%2Fredis-exposer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Erisa","download_url":"https://codeload.github.com/Erisa/redis-exposer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253877496,"owners_count":21977642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","express","redis"],"created_at":"2024-10-24T14:43:56.773Z","updated_at":"2025-05-13T04:53:33.029Z","avatar_url":"https://github.com/Erisa.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Erisa"],"categories":[],"sub_categories":[],"readme":"# Redis data exposer\n\nThis was created for [Cliptok](https://github.com/Erisa/Cliptok) and not intended for use outside of it.\nUse at your own peril.\n\nThis application will serve an API that will return read-only data from your configured Redis server.\n\n## Disclaimer\n\nThe code here is not the best code it could have been. I am not overly proficient with JavaScript and this code was written to serve a single purpose. Please be gentle.\n\nIf you use this for some reason and have an issue, please report it.\n\n## Setup\n\nEnvironment variables (none are required):\n- `PORT`: The port to listen on. Default is `3000`.\n- `REDIS_URL`: URL pointing to the redis server to connect to. Default is localhost.\n- `SECRET`: The secret to pass for authorization. Default is `superscarysecret`.\n\nRun Docker image `ghcr.io/erisa/redis-exposer` or clone, `yarn` and `yarn start`.\n\n## Usage\n\nRequired: `Authorization` header or `secret` query parameter with the correct value.\n\n### `GET /:key`\n\nIf `key` held `value`, you would get something like: \n```json\n{\n    \"code\": 200,\n    \"data\": \"value\"\n}\n```\n\nIf the value is JSON, it will be parsed.\nFor example if `key` held `{\"thing\": \"otherthing\"}` you would get:\n```json\n{\n    \"code\": 200,\n    \"data\": {\n        \"thing\": \"otherthing\"\n    }\n}\n```\n\nBig numbers will be converted to strings. Or maybe it was all numbers, I don't remember.\n\nIf the key is a list, it will be returned as such:\n```json\n{\n    \"code\": 200,\n    \"data\": [\n        \"thing\",\n        \"otherthing\"\n    ]\n}\n```\n\nYou can also put JSON inside a list item, if you want.\n\nIf the value is a hash, it will return all items, same as JSON:\n```json\n{\n    \"code\": 200,\n    \"data\": {\n        \"thing\": \"otherthing\"\n    }\n}\n```\n\n### `GET /:key/:value`\n\nIf the key is not a hash or a set, you get yelled at:\n\n```json\n{\n  \"code\": 400,\n  \"message\": \"Bad request, key is not a hash or set and cannot be accessed like one. Try /:key.\"\n}\n```\n\nIf the value does not exist, you also get yelled at:\n```json\n{\n  \"code\": \"404\",\n  \"message\": \"Key/value pair does not exist or is null.\"\n}\n```\n\nBut if a hash exists, you get data:\n```json\n{\n    \"code\": 200,\n    \"data\": \"thing in a hash\"\n}\n```\n\nIf the key is a set and value does not exist, you get a slightly different error:\n```json\n{\n  \"code\": 404,\n  \"memberExists\": false,\n  \"message\": \"Member does not exist in the set.\"\n}\n```\n\nIf the key is a set and the value exists, you get confirmation and the value back again:\n```json\n{\n  \"code\": 200,\n  \"memberExists\": true,\n  \"data\": \"thing1\"\n}\n```\n\n## The end\n\nThat's it. There's nothing more to tell.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferisa%2Fredis-exposer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferisa%2Fredis-exposer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferisa%2Fredis-exposer/lists"}