The Koyeb CLI (Command Line Interface) is a powerful tool to manage your Koyeb serverless infrastructure directly from your terminal.
The CLI can be installed from pre-compiled binaries for macOS (darwin), Linux and Windows. You can download the appropriate version from the Releases page.
You can install the latest version of the Koyeb CLI on macOS using Homebrew:
brew install koyeb/tap/koyeb
You can upgrade an existing installation of the Koyeb CLI running:
brew upgrade koyeb
To install the latest koyeb
binary with go, simply run:
go get github.com/koyeb/koyeb-cli/cmd/koyeb
go install github.com/koyeb/koyeb-cli/cmd/koyeb
If you need a go environment, follow the official Go installation documentation.
Generate an API token and run koyeb login
to create a new configuration file.
cloudflare workers example
const SingleDay = 'appname.app.com'
const DoubleDay = 'appname.app.com'
addEventListener(
"fetch",event => {
let nd = new Date();
if (nd.getDate()%2) {
host = SingleDay
} else {
host = DoubleDay
}
let url=new URL(event.request.url);
url.hostname=host;
let request=new Request(url,event.request);
event. respondWith(
fetch(request)
)
}
)