我正在尝试使用以下教程将Spring Boot应用程序部署到Google Cloud:
我遵循了该教程中的所有内容,但所有电话都返回: 找不到404
我的spring boot安全类是:
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.cors();
http.authorizeRequests()
.anyRequest()
.permitAll()
.and().csrf().disable();
}
@Bean
CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:4200"));
configuration.addAllowedMethod("*");
configuration.addAllowedHeader("*");
configuration.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
}
}
因此,所有内容都可以测试,但这仍然行不通。
我用
运行./mvnw -DskipTests appengine:devserver