最近玩了一下在spingboot2.0 中使用thymeleaf 实现前后端分离部署
代码中采用spingboot2.0 + thymeleaf ,部署环境 centos7+nginx+jdk8
具体springboot和thymeleaf怎么整合就不说啦,就截几张图看看前后端分离咋配置的哈!

代码结构:
SpringBoot 2.0 使用 Thymeleaf 实现前后端分离

html页面、js、css模块:
SpringBoot 2.0 使用 Thymeleaf 实现前后端分离application.yml配置:
SpringBoot 2.0 使用 Thymeleaf 实现前后端分离
代码中的配置就是这么简单,就已经可以啦,下面再看看nginx中的配置哈!
把项目中resource的static和template目录(即html/js/css)打包上传到nginx的html中
SpringBoot 2.0 使用 Thymeleaf 实现前后端分离
nginx里的配置:
SpringBoot 2.0 使用 Thymeleaf 实现前后端分离
启动nginx,启动后台包就可以啦

参考文章: https://blog.csdn.net/qq_39211866/article/details/84452874

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
  • 2021-06-12
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
猜你喜欢
  • 2022-01-21
  • 2022-12-23
  • 2021-08-25
  • 2021-05-07
  • 2021-05-12
  • 2021-04-26
相关资源
相似解决方案