项目作者: d1vshar

项目描述 :
http/1.1 static web server in kotlin
高级语言: Kotlin
项目地址: git://github.com/d1vshar/kota.git
创建时间: 2020-06-10T18:29:04Z
项目社区:https://github.com/d1vshar/kota

开源协议:MIT License

下载


kota :tea: [WIP]

Kota is a HTTP/1.1 implementation of a concurrent static web server in Kotlin.

Work in progress. Many important features like caching are not implemented.

Since it’s a static web server (like GitHub pages), it only supports GET requests.

Building

Build using these -

```shell script
git clone https://github.com/l0llygag/kota
cd kota
gradle build

  1. Two jars will be built in `build/libs/` - `kota-x.x.x.jar` and `kota-x.x.x-all.jar` (with dependencies)
  2. ## Usage
  3. CLI arguments:
  4. Argument Name | CLI Name | Description | Type | Default
  5. --------------|----------|-------------|------| -------
  6. Port | --port | Port on which the server will listen for requests. | number | 8080
  7. Public Folder | --public | Root folder to serve files. Needs to end with '/' | string | public/
  8. All static files that need to be hosted should be in the `Public Folder` provided using CLI argument. (default: `public/`)

— root/
|— public/
| |— index.html
| |— subfolders/
|— kota-x.x.x-all.jar

  1. To run the jar:
  2. `java -jar build/libs/kota-x.x.x-all.jar --port PORT --public FOLDER/`
  3. > You will need JDK 8+
  4. In case you want to use it as a library, you can include the jar in your class-path and use
  5. ```kotlin
  6. val serverConfiguration = ServerConfiguration(...)
  7. Server(serverConfiguration).listen()

License

MIT