controller.TestController
@RestController // 将数据以json形式返回
public classTestController {
@GetMapping("/test")
public String test() {
return "hello <https://github.com/webVueBlog/JavaGuideInterview>"
}
}
1679721134006.png
1679721175446.png
1679721228189.png
1679721268842.png
1679721332998.png
1679721419897.png
1679721895855.png
image.png
image.png
image.png
image.png
apt-get install maven
或者
yum install maven
解压到宝塔面板/www/wwwroot目录。
image.png
打开【终端】,运行cd命令进入项目目录的server目录,运行编译命令。首次编译需要下载依赖,时间会比较长。
cd /www/wwwroot/xxx/server
mvn clean install -Dmaven.test.skip=true -f pom.xml
image.png
image.png
点击【设置】-【伪静态】,填写下面伪静态信息,【保存】。
location / {
try_files $uri $uri/ /index.html;
}
image.png
点击【SSL】-【Let's Encrypt】,选择【文件验证】,勾选域名,点击【申请】,等待完成https证书申请。
image.png
image.png
PC端和手机端
# 请将伪静态规则或自定义NGINX配置填写到此
location /pc {
try_files $uri $uri/ /pc/index.html;
}
location /mobile {
try_files $uri $uri/ /mobile/index.html;
}
点击【SSL】-【Let's Encrypt】,选择【文件验证】,勾选域名,点击【申请】,等待完成https证书申请。
如果该产品有PC端网页前台访问:https://添加的前台域名/pc,即可访问PC端。如果该产品有手机网页端前台访问:https://添加的前台域名/mobile,即可访问PC端。默认访问域名,会自动根据访问者使用PC或手机自动跳转。
仓库地址:https://github.com/webVueBlog/JavaGuideInterview
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有