server to generate uniq-id with twitter-snowflake arithmetic
$ docker run -p 3000:3000 --name snowflake yeliex/snowflake
$ curl localhost:3000
# or
$ curl localhost:3000?type=json
# or
$ curl -H "Accept: application/json" localhost:3000
$ docker run -p 3000:3000 --name snowflake -v ./config:/snowflake/config yeliex/snowflake
# config/config.yml
security:
token:
- token1
- token2
$ curl -H "X-TOKEN: token1" localhost:3000
# OR
$ curl localhost:3000?token=token1
- production: /snowflake/config.yml
- development: ./config/config.yml
# Server base
server:
listenPort: 3000
snowflake:
region: 1
worker: 1
endpoint: 1 # replace region and worker
security:
token: # if empty, run without auth
- token1
- token2
health check
gen id
/?type=json
OR header Accept: application/json
/?token=token
OR header X-Token: token