【创建个人服务器】二.创建一个Springboot项目

目录

【创建个人服务器】一.安装软件-数据库
【创建个人服务器】二.创建一个Springboot项目
【创建个人服务器】三.部署springboot
【创建个人服务器】四.第一个应用:文档合并
【创建个人服务器】五.项目部署

创建项目

1.使用idea创建一个springboot项目



【】若initializr server不稳定
可使用阿里云的server:https://start.aliyun.com

2.yml文件

server:
  port: 8081
  servlet:
    context-path: /lin
  session:
    timeout: 4200
  tomcat:
    uri-encoding: UTF-8
    max-connections: 200
    max-threads: 300
    accept-count: 100
    basedir: /home/temp #改变临时文件位置

multipart:
  enabled: true
  maxFileSize: 1024Mb
  maxRequestSize: 1024Mb

security:
  basic:
    enabled: false
  user:
    name: admin
    password: admin

mybatis:
  mapper-locations: classpath*:/mapper/*Mapper.xml
  type-aliases-package: com.raiyon.lin.entity

spring:
  application:
    name: lin
  datasource:
    url: jdbc:postgresql://【数据库地址】:5432/lin?useUnicode=true&characterEncoding=utf8
    username: postgres
    password: postgres
    driver-class-name: org.postgresql.Driver
    initialSize: 10
    minIdle: 10
    maxActive: 50
    maxWait: 60000
    timeBetweenEvictionRunsMillis: 60000
    minEvictableIdleTimeMillis: 30000
    validationQuery: SELECT 1
    testWhileIdle: true
    testOnBorrow: false
    testOnReturn: false
    poolPreparedStatements: true
    maxPoolPreparedStatementPerConnectionSize: 20
    filters: stat,wall,slf4j
    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
    useGlobalDataSourceStat: true
posted @ 2022-09-22 14:00  Raiyon  阅读(28)  评论(0编辑  收藏  举报