kotlin-todo-app
所属分类:Kotlin编程
开发工具:JavaScript
文件大小:152KB
下载次数:0
上传日期:2018-08-06 19:53:31
上 传 者:
sh-1993
说明: 用Kotlin编程语言开发的Todo Web App实验
(Todo Web App Experiment Developed In Kotlin Programming Language)
文件列表:
.travis.yml (107, 2018-08-07)
Dockerfile (416, 2018-08-07)
build.gradle (2001, 2018-08-07)
docker-compose.yml (514, 2018-08-07)
gradle (0, 2018-08-07)
gradle\wrapper (0, 2018-08-07)
gradle\wrapper\gradle-wrapper.jar (54706, 2018-08-07)
gradle\wrapper\gradle-wrapper.properties (230, 2018-08-07)
gradlew (5296, 2018-08-07)
gradlew.bat (2260, 2018-08-07)
settings.gradle (38, 2018-08-07)
src (0, 2018-08-07)
src\main (0, 2018-08-07)
src\main\kotlin (0, 2018-08-07)
src\main\kotlin\net (0, 2018-08-07)
src\main\kotlin\net\ilkinulas (0, 2018-08-07)
src\main\kotlin\net\ilkinulas\Config.kt (458, 2018-08-07)
src\main\kotlin\net\ilkinulas\Todo.kt (2743, 2018-08-07)
src\main\kotlin\net\ilkinulas\WebApp.kt (2085, 2018-08-07)
src\main\resources (0, 2018-08-07)
src\main\resources\logback.xml (534, 2018-08-07)
src\main\resources\public (0, 2018-08-07)
src\main\resources\public\css (0, 2018-08-07)
src\main\resources\public\css\todo.css (447, 2018-08-07)
src\main\resources\public\index.html (3176, 2018-08-07)
src\main\resources\public\js (0, 2018-08-07)
src\main\resources\public\js\axios.min.js (12941, 2018-08-07)
src\main\resources\public\js\vue.js (288566, 2018-08-07)
src\main\resources\simplelogger.properties (43, 2018-08-07)
src\main\resources\sql (0, 2018-08-07)
src\main\resources\sql\todo.sql (37, 2018-08-07)
src\main\resources\todo.properties (106, 2018-08-07)
src\test (0, 2018-08-07)
src\test\kotlin (0, 2018-08-07)
src\test\kotlin\net (0, 2018-08-07)
src\test\kotlin\net\ilkinulas (0, 2018-08-07)
src\test\kotlin\net\ilkinulas\EndToEndTest.kt (5767, 2018-08-07)
... ...
# Todo Web Application
This repo contains a *todo* web application written in kotlin.
The demo app is developed to provide samples to blog posts at [http://ilkinulas.github.io/](http://ilkinulas.github.io/).
### Build And Run
1. `./gradlew clean shadowJar`
2. `java -jar ./build/libs/kotlin-todo-app-1.0-SNAPSHOT-all.jar`
By default application uses [h2](http://www.h2database.com/html/main.html) (in memory) database.
You can configure it to use mysql database with the `-DDB_URL=....` program argument.
```
java \
-DDB_URL="jdbc:mysql://127.0.0.1:3306/tododb" \
-jar ./build/libs/kotlin-todo-app-1.0-SNAPSHOT-all.jar`
```
### Docker: Build, Run, Publish
To build a docker image run:
`docker build -t ilkinulas/todoapp:1.0 .`
You can start the container by running command below. This default setup will use the in memory database.
`docker run -p 9000:9000 ilkinulas/todoapp:1.0`
MySQL database usage is enabled by the environment variable DB_URL as seen below:
```
docker run \
-p 9000:9000 \
-e DB_URL="jdbc:mysql://172.23.0.1:3306/tododb" \
ilkinulas/todoapp:1.0
```
To publish a docker image to docker repo you should use the `docker push` command. I have published the docker image of this demo project with the command below:
`docker push ilkinulas/todoapp:1.0`
Here is the `docker hub` url of the image repository: https://hub.docker.com/r/ilkinulas/todoapp/
### docker-compose
Docker-compose file contains two images. mysql & todoapp.
After running `docker-compose up`, mysql database and todo web app will be launched.
The application will be available at `http://localhost:9000`
`docker-compose down` command will stop the app and the database containers.
近期下载者:
相关文件:
收藏者: