{"id":20911884,"url":"https://github.com/yeliex/snowflake","last_synced_at":"2025-05-13T07:32:37.314Z","repository":{"id":32918235,"uuid":"141650074","full_name":"yeliex/snowflake","owner":"yeliex","description":"server to generate uniq-id with twitter-snowflake arithmetic","archived":false,"fork":false,"pushed_at":"2023-05-11T07:01:10.000Z","size":461,"stargazers_count":6,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-01T10:18:58.173Z","etag":null,"topics":["docker","idgenerator","nodejs","snowflake"],"latest_commit_sha":null,"homepage":"https://id.yeliex.com","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/yeliex.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":"2018-07-20T01:52:04.000Z","updated_at":"2024-06-28T06:29:29.000Z","dependencies_parsed_at":"2022-08-07T18:16:18.864Z","dependency_job_id":null,"html_url":"https://github.com/yeliex/snowflake","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeliex%2Fsnowflake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeliex%2Fsnowflake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeliex%2Fsnowflake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeliex%2Fsnowflake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeliex","download_url":"https://codeload.github.com/yeliex/snowflake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224844651,"owners_count":17379241,"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":["docker","idgenerator","nodejs","snowflake"],"created_at":"2024-11-18T14:24:17.558Z","updated_at":"2024-11-18T14:24:18.178Z","avatar_url":"https://github.com/yeliex.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# snowflake\nserver to generate uniq-id with twitter-snowflake arithmetic\n\n\n![https://hub.docker.com/r/yeliex/snowflake/](https://img.shields.io/badge/-docker-blue.svg?type=flat-square\u0026logo=docker)\n![https://hub.docker.com/r/yeliex/snowflake/](https://img.shields.io/github/package-json/v/yeliex/snowflake.svg?type=flat-square\u0026logo=docker\u0026label=version)\n![https://npmjs.org/package/@yeliex/snowflake](https://img.shields.io/npm/v/@yeliex/snowflake.svg?type=flat-square\u0026logo=npm\u0026label=@yeliex/snowflake)\n\n### Usage\n```bash\n$ docker run -p 3000:3000 --name snowflake yeliex/snowflake\n$ curl localhost:3000\n# or\n$ curl localhost:3000?type=json\n# or\n$ curl -H \"Accept: application/json\" localhost:3000\n```\n\n## Authorization\n```bash\n$ docker run -p 3000:3000 --name snowflake -v ./config:/snowflake/config yeliex/snowflake\n\n# config/config.yml\nsecurity:\n  token:\n    - token1\n    - token2\n    \n$ curl -H \"X-TOKEN: token1\" localhost:3000\n# OR\n$ curl localhost:3000?token=token1\n```\n\n### Configuration\n- production: /snowflake/config.yml\n- development: ./config/config.yml\n\n```bash\n# Server base\nserver:\n  listenPort: 3000\n\nsnowflake:\n  region: 1\n  worker: 1\n  endpoint: 1 # replace region and worker\n\nsecurity:\n  token: # if empty, run without auth\n    - token1\n    - token2\n```\n\n### api\n#### ALL /_health\nhealth check\n\n#### GET /\ngen id\n##### Return json\n`/?type=json` OR header `Accept: application/json`\n\n##### Auth\n`/?token=token` OR header `X-Token: token`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeliex%2Fsnowflake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeliex%2Fsnowflake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeliex%2Fsnowflake/lists"}