forked from ktorio/ktor-website-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
88 additions
and
29 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,7 +1,7 @@ | ||
.gradle/ | ||
build/ | ||
/.gradle | ||
/.idea | ||
/out | ||
/build | ||
*.iml | ||
out/ | ||
.DS_Store | ||
.idea/ | ||
gradle/ | ||
*.ipr | ||
*.iws |
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
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ktor_version=1.3.2 | ||
kotlin.code.style=official | ||
kotlin_version=1.3.70 | ||
logback_version=1.2.1 |
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/com/jetbrains/handson/website/Application.kt
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.jetbrains.handson.website | ||
|
||
import io.ktor.application.Application | ||
import io.ktor.http.content.resources | ||
import io.ktor.http.content.static | ||
import io.ktor.routing.routing | ||
|
||
|
||
fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args) | ||
|
||
fun Application.module() { | ||
routing { | ||
static("/static") { | ||
resources("files") | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ktor { | ||
deployment { | ||
port = 8080 | ||
port = ${?PORT} | ||
} | ||
application { | ||
modules = [ com.jetbrains.handson.website.ApplicationKt.module ] | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Static Page</title> | ||
</head> | ||
<body> | ||
<h1>Static Page</h1> | ||
<p> | ||
|
||
</p> | ||
<p> | ||
This is a static page! | ||
</p> | ||
<img src="ktor.png" alt="Ktor Logo"> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<configuration> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
<root level="trace"> | ||
<appender-ref ref="STDOUT"/> | ||
</root> | ||
<logger name="org.eclipse.jetty" level="INFO"/> | ||
<logger name="io.netty" level="INFO"/> | ||
</configuration> |