Before you running several command in your terminal, please ensure you have installed the Kotlin compiler. For more details please read kotlin documentation here Kotlin command-line compiler. I want to highlight for how to install the Kotlin compiler in your local machine, please following steps below :
📝 Install Kotlin on UNIX-based systems such as OS X, Linux, Cygwin, FreeBSD, and Solaris is SDKMAN!! To install the Kotlin compiler via SDKMAN!, run the following command in a terminal :
$sdk install kotlin
📝 Alternatively, on OS X you can install the compiler via Homebrew from the command line :
$brew update
$brew install kotlin
📝 If you use Snap on Ubuntu 16.0.4 or later, you can install the compiler from the command line :
$sudo snap install --classic kotlin
-
If you have kotlin scripts file inside other directory. Please ensure navigate up one directory level, run the following command in a terminal for example :
cd scripts
scripts is directory name. -
Execute kotlin scripts file, run the following command in a terminal :
kotlin api-endpoint-test.main.kts
-
Input host url type (e.g.: github, spotify). For this case we provide github and spotify endpoints as host url type. Run the following command in a terminal :
-
Input endpoint that you will testing. For example in this case, we input
events
as endpoint github apps. -
Input OAuth Token (if using spotify API), this section you can skip for input token if you choosing github API.
-
After input oAuth token section is done. Script will show information to waiting response from API. Then, we will see response success or failure.