mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-09 05:48:20 +00:00
Added route to serve static resources with prepended baseUrl (#19)
This commit is contained in:
parent
6f9f567f6e
commit
31200ad64f
22
src/main/java/tech/ailef/dbadmin/external/MvcConfig.java
vendored
Normal file
22
src/main/java/tech/ailef/dbadmin/external/MvcConfig.java
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package tech.ailef.dbadmin.external;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableWebMvc
|
||||||
|
public class MvcConfig implements WebMvcConfigurer {
|
||||||
|
@Autowired
|
||||||
|
private DbAdminProperties properties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
System.out.println("ADDING");
|
||||||
|
registry.addResourceHandler("/" + properties.getBaseUrl() + "/**")
|
||||||
|
.addResourceLocations("classpath:/static/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user