【发布时间】:2017-04-07 17:48:48
【问题描述】:
我有一个应用程序,其中整个前端部分都在资源中。我想把事情分开。并且有单独的 UI 服务器,例如由 gulp 提供。
所以我假设我的服务器应该为客户端呈现的所有请求返回index.html。
例如:我有 'user/:id' 路由,它通过角度路由进行管理,不需要任何服务器。如何配置服务器不会重新加载或将我重定向到任何地方?
我的安全配置如下(不知道它是否负责这些事情):
public class Application extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.antMatcher("/**").authorizeRequests().antMatchers("/", "/login**", "/webjars/**", "/app/**", "/app.js")
.permitAll().anyRequest().authenticated().and().exceptionHandling()
.authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/")).and().logout()
.logoutSuccessUrl("/").permitAll().and().csrf()
.csrfTokenRepository(csrfTokenRepository()).and()
.addFilterAfter(csrfHeaderFilter(), CsrfFilter.class)
.addFilterBefore(ssoFilter(), BasicAuthenticationFilter.class);
}
【问题讨论】:
标签: java angularjs spring gulp single-page-application