Skip to content

Commit 3a75519

Browse files
authored
Merge pull request #439 from danthe1st/cors
add CORS to API
2 parents d9bdcc3 + 192429d commit 3a75519

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package net.javadiscord.javabot.api.routes;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
5+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6+
7+
/**
8+
* Configures the web API.
9+
* This class enables CORS for all endpoints.
10+
*/
11+
@Configuration
12+
public class WebConfigurer implements WebMvcConfigurer {
13+
@Override
14+
public void addCorsMappings(CorsRegistry registry) {
15+
registry.addMapping("/**");
16+
}
17+
}

0 commit comments

Comments
 (0)