Added deploy script.
This commit is contained in:
parent
ba409985e5
commit
74cf5736f0
|
@ -0,0 +1 @@
|
||||||
|
VITE_API_URL=http://localhost:8080/api
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env dub
|
||||||
|
/+ dub.sdl:
|
||||||
|
dependency "dsh" version="~>1.6.1"
|
||||||
|
+/
|
||||||
|
import dsh;
|
||||||
|
|
||||||
|
const DEST = "../src/main/resources/static";
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
print("Deploying Vue app to Spring's /static directory.");
|
||||||
|
runOrQuit("npm run build");
|
||||||
|
rmdirRecurse(DEST);
|
||||||
|
copyDir("./dist", DEST);
|
||||||
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
public class WebConfig implements WebMvcConfigurer {
|
public class WebConfig implements WebMvcConfigurer {
|
||||||
@Override
|
@Override
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
registry.addResourceHandler("/static/**")
|
registry.addResourceHandler("/**")
|
||||||
.addResourceLocations("classpath:/static/");
|
.addResourceLocations("classpath:/static/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,6 @@ public class SwitchResponse extends PathNodeResponse {
|
||||||
public SwitchResponse(Switch s) {
|
public SwitchResponse(Switch s) {
|
||||||
super(s);
|
super(s);
|
||||||
this.possibleConfigurations = s.getPossibleConfigurations().stream().map(SwitchConfigurationResponse::new).toList();
|
this.possibleConfigurations = s.getPossibleConfigurations().stream().map(SwitchConfigurationResponse::new).toList();
|
||||||
this.activeConfiguration = new SwitchConfigurationResponse(s.getActiveConfiguration());
|
this.activeConfiguration = s.getActiveConfiguration() == null ? null : new SwitchConfigurationResponse(s.getActiveConfiguration());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue