mirror of https://github.com/halo-dev/halo
Add support for API documentation (#2082)
parent
b4e9b54ffe
commit
3cf2f9d7e1
|
@ -55,6 +55,8 @@ dependencies {
|
|||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation "org.springframework.boot:spring-boot-starter-jetty"
|
||||
|
||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.0-M2'
|
||||
implementation "org.flywaydb:flyway-core"
|
||||
implementation "org.flywaydb:flyway-mysql"
|
||||
|
||||
|
|
|
@ -83,7 +83,10 @@ public class WebSecurityConfig {
|
|||
http
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.antMatchers(providerSettings.getTokenEndpoint()).permitAll()
|
||||
// for static path
|
||||
.antMatchers("/static/js/**").permitAll()
|
||||
// for swagger ui
|
||||
.antMatchers("/v3/api-docs/**", "/swagger-ui/**", "/swagger-ui.html").permitAll()
|
||||
.antMatchers("/api/**", "/apis/**").access(requestInfoAuthorizationManager())
|
||||
.anyRequest().access(requestInfoAuthorizationManager())
|
||||
)
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
server:
|
||||
port: 8090
|
||||
spring:
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
output:
|
||||
ansi:
|
||||
enabled: always
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
|
||||
# H2 database configuration.
|
||||
driver-class-name: org.h2.Driver
|
||||
url: jdbc:h2:file:~/halo-next/db/halo;AUTO_SERVER=TRUE
|
||||
username: admin
|
||||
password: 123456
|
||||
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: update
|
||||
open-in-view: false
|
||||
show-sql: true
|
||||
halo:
|
||||
security:
|
||||
oauth2:
|
||||
jwt:
|
||||
public-key-location: classpath:app.pub
|
||||
private-key-location: classpath:app.key
|
||||
logging:
|
||||
level:
|
||||
run.halo.app: DEBUG
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: true
|
|
@ -6,10 +6,6 @@ spring:
|
|||
output:
|
||||
ansi:
|
||||
enabled: always
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true
|
||||
log-condition-evaluation-delta: false
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
|
||||
|
@ -34,20 +30,14 @@ spring:
|
|||
hibernate:
|
||||
ddl-auto: update
|
||||
open-in-view: false
|
||||
flyway:
|
||||
enabled: true
|
||||
locations:
|
||||
- classpath:db/migration/common
|
||||
- classpath:db/migration/{vendor}
|
||||
|
||||
halo:
|
||||
security:
|
||||
oauth2:
|
||||
jwt:
|
||||
public-key-location: classpath:app.pub
|
||||
private-key-location: classpath:app.key
|
||||
logging:
|
||||
level:
|
||||
run.halo.app: DEBUG
|
||||
org.hibernate: INFO
|
||||
org.hibernate.type.descriptor.sql.BasicBinder: INFO
|
||||
org.hibernate.type.descriptor.sql.BasicExtractor: INFO
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: false
|
||||
|
|
Loading…
Reference in New Issue