-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,56 @@ | ||
# ktor-cli | ||
Command-line tool for creating Ktor projects | ||
# Ktor CLI | ||
Ktor CLI is a command-line tool that brings the capability to create and run [Ktor](https://ktor.io/) applications from the command line. | ||
|
||
## Install CLI tools | ||
|
||
### macOS | ||
|
||
You can install Ktor CLI tools on macOS using [Homebrew](https://brew.sh/) as follows: | ||
1. Add a Ktor repository using the `brew tap` command: | ||
``` | ||
brew tap ktorio/ktor | ||
``` | ||
2. Install Ktor CLI tools using `brew install`: | ||
``` | ||
brew install --build-from-source ktor\ | ||
``` | ||
|
||
### Linux | ||
|
||
On Linux, you can install Ktor CLI tools using [snap](https://snapcraft.io/): | ||
|
||
``` | ||
snap install --beta --classic ktor | ||
``` | ||
|
||
### Available commands | ||
You can get a list of Ktor commands available to you by typing `ktor --help`. | ||
|
||
|
||
## Create a project | ||
|
||
To create a new Ktor project, pass a project name to the `ktor generate` command: | ||
|
||
``` | ||
ktor generate ktor-sample | ||
``` | ||
|
||
This command generates a simple Ktor project that uses the Gradle build system with Kotlin DSL. | ||
|
||
|
||
## Run a project | ||
|
||
To run the existing Ktor application, use the `ktor start` command. | ||
This command accepts the name of the directory where the project is placed: | ||
|
||
``` | ||
ktor start ktor-sample | ||
``` | ||
|
||
With the default configuration, the terminal should show the following message: | ||
|
||
``` | ||
[main] INFO ktor.application - Responding at http://0.0.0.0:8080 | ||
``` | ||
|
||
This means that the server is ready to accept requests at the http://0.0.0.0:8080 address. |