Gosling is a lightweight HTTP redirects generator.
There are multiple ways to get Gosling.
For macOS you may use homebrew to download gosling
from the command line
brew install leonidboykov/tap/gosling
For Windows you may use scoop to download gosling
from the command line
scoop bucket add gosling https://github.com/leonidboykov/scoop-bucket.git
scoop install gosling
docker push leonidboykov/gosling:tagname
You may also get the latest version from master
branch with
go get -u github.com/leonidboykov/cmd/gosling
Create redirects.json
with the following JSON structure
{
"/": "https://root_redirect",
"project_1": "https://project_1",
"project_2": "https://project_2"
}
Then simply run
gosling
This command will produce a public
folder with HTML redirects files
.
├── public
│ ├── index.html
│ ├── project_1
│ │ └── index.html
│ └── project_2
│ └── index.html
└── redirects.json
You may also override default setting with the following flags
gosling -o build
will write HTML files to build
folder instead of public
gosling -r my_redirects.json
will use my_redirects.json
file instead of redirects.json
gosling -v
will print current verson and exit
There is also Docker image available on Docker Hub. You can use the following .gitlab-ci.yml
config file to build redirects with gosling
image: leonidboykov/gosling:latest
pages:
script:
- gosling
artifacts:
paths:
- public
only:
- master
gosling
is free software licensed under the MIT license.