美文网首页
springboot kotlin 极速开发(一) ~ 创建项目

springboot kotlin 极速开发(一) ~ 创建项目

作者: 天高s | 来源:发表于2018-10-11 15:09 被阅读0次

一天完成一个 bbs

本来想用 kotlin 的 kotr, 要用 gradle,学习曲线还是挺难的,还是实际一点,用数据的技术快速搞定吧

创建项目

http://start.spring.io

图片

下载前端模板

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

但是这个时候资源文件都是不对的

改一下资源文件就显示正常了

图片

相关文章

网友评论

      本文标题:springboot kotlin 极速开发(一) ~ 创建项目

      本文链接:https://www.haomeiwen.com/subject/uiubaftx.html