Coder Social home page Coder Social logo

ktor-cli's Introduction

Ktor CLI

Ktor CLI is a command-line tool that brings the capability to create and run Ktor applications from the command line.

Install CLI tools

macOS

You can install Ktor CLI tools on macOS using Homebrew 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:

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.

ktor-cli's People

Contributors

andreyaksenov avatar e5l avatar ololoshechkin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ktor-cli's Issues

`brew install` not working on M1 Mac (`arm64`)

Env

ProductName:	macOS Monterey
ProductVersion:	12.5
M1 (Arm64)

brew install fails in invalid CPU arch error.

Error

$ brew tap ktorio/ktor
...
$ brew install --build-from-source ktor                                                                                                                                                   
ktor: The x86_64 architecture is required for this software.
Error: ktor: An unsatisfied requirement failed this build.

Linux install inop

Can't get past step 1.

System: Xubuntu 20.04.5 LTS 5.15.0-56-generic

$ snap install --beta --classic ktor

Warning: flag --classic ignored for strictly confined snap ktor
ktor (beta) 2.0.0-eap-3 from Ktor (ololoshechkin) installed

$ ktor generate ktor-sample

Uncaught Kotlin exception: okio.FileNotFoundException: No such file or directory
at kfun:okio#errnoToIOException(kotlin.Int){}okio.IOException (0x585f14)
at kfun:okio#variantSource__at__okio.PosixFileSystem(okio.Path){}okio.Source (0x5935bb)
at kfun:io.ktor.generator.cli.installer.KtorInstaller.getRcProperty#internal (0x5cc1a0)
at kfun:io.ktor.generator.cli.installer.KtorInstaller.installJdkIfAbsent#internal (0x5ccd19)
at kfun:io.ktor.generator.cli.installer.KtorInstaller#downloadKtorProject(kotlin.String){} (0x5cd84f)
at kfun:GenerateProject#execute(){} (0x5c5453)
at kfun:kotlinx.cli.ArgParser#parse(kotlin.collections.List<kotlin.String>){}kotlinx.cli.ArgParserResult (0x59a11d)
at kfun:kotlinx.cli.ArgParser#parse(kotlin.Array<kotlin.String>){}kotlinx.cli.ArgParserResult (0x596e79)
at Init_and_run_start (0x692b31)
at __libc_start_main (0x7f6b0d9d8c87)
at (0x406211)
at ((nil))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.