springboot kotlin 极速开发(一) ~ 创建项目
2018-10-11 本文已影响0人
天高s
一天完成一个 bbs
本来想用 kotlin 的 kotr, 要用 gradle,学习曲线还是挺难的,还是实际一点,用数据的技术快速搞定吧
创建项目

下载前端模板
https://www.layui.com/template/fly/
IDEA 打开项目
拷贝资源文件

配置数据库
spring.datasource.url=jdbc:mysql://localhost:3306/kbbs
spring.datasource.username=root
spring.datasource.password=123qwe
# update 模式会自动建表,有改动后也会更新,不过不会删原来的东西
spring.jpa.properties.hibernate.hbm2ddl.auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.properties.hibernate.connection.release_mode=auto
编写测试类
@Controller
class IndexController {
@GetMapping("/")
fun index() = "index"
}
启动访问
默认加了 Security 依赖,访问的时候有密码,在启动的控制台中可以找到

OK
但是这个时候资源文件都是不对的
改一下资源文件就显示正常了
