mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-08-06 12:11:13 +00:00
Added route to serve static resources with prepended baseUrl (#19)
This commit is contained in:
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/");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user