Microservice for downloading the latest asset of GitHub release.
MIT License
Microservice for downloading the latest asset of GitHub release.
Further reading: [] Microservice - Dockerize Zeit JavaScript
One click deploys to now
Download from GitHub latest release.
$ ORIGIN=$YOUR_DOMAIN \
ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN \
./micro-github-latest-macos --port $PORT
Note: You can run it without Node.js installed.
Pull from dockerhub.
$ docker pull evenchange4/micro-github-latest:latest
$ docker run --rm -it \
-p $PORT:3000 \
-e "ORIGIN=YOUR_DOMAIN" \
-e "ACCESS_TOKEN=GITHUB_ACCESS_TOKEN" \
evenchange4/micro-github-latest:latest
Install from npm.
$ npm i micro-github-latest -g
$ ORIGIN=$YOUR_DOMAIN \
ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN \
micro-github-latest --port $PORT
Note: You should use Node.js >= 8 .
ENV | Required | Default | Description |
---|---|---|---|
ORIGIN |
* |
Setup access-control-allow-origin for CORS. |
|
ACCESS_TOKEN |
Setup GitHub access token with the repo scope. |
Note: You should use ACCESS_TOKEN to increase the rate limit.
$ micro-github-latest --help
Usage: micro-github-latest <command> [options]
Options:
-p, --port HTTP server PORT [default: 3000]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Method | Pathname | Description |
---|---|---|
GET | /:owner/:repo/latest |
302 redirect to the first asset of latest release. |
GET | /:owner/:repo/:name/latest |
302 redirect to the first matched one by asset name of latest release. |
GET | /rate_limit |
Get your current rate limit status. |
Note: You should deploy your own service for production usage.
$ git clone https://github.com/evenchange4/micro-github-latest.git
$ yarn install --pure-lockfile
$ yarn run dev # dev server
$ yarn start # prod server
$ yarn run pkg # output binary files
$ yarn run format
$ yarn run eslint
$ yarn run test:watch
$ docker build -t micro-github-latest .
# Push to dockerhub
$ git push
Note: Multi-stage builds are a new feature in Docker 17.05.
$ npm version patch
$ git push
$ yarn run test
).