3 Commits
1.0 ... 1.0.1

Author SHA1 Message Date
28a7a60de3 Updated version number 2024-04-27 16:23:19 -04:00
4a5a221605 Updated CORS to use a property 2024-04-27 16:23:05 -04:00
3b9a984659 Update version SNAPSHOT 2024-04-27 14:48:15 -04:00
4 changed files with 35 additions and 2 deletions

View File

@@ -6,7 +6,7 @@
<groupId>com.mattrixwv.cipherstream</groupId>
<artifactId>cipherstream-api</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
<version>1.0.1</version>
<name>CipherStream API</name>
<url>https://api.cipherstream.mattrixwv.com</url>

View File

@@ -1,6 +1,7 @@
package com.mattrixwv.cipherstream.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
@@ -11,9 +12,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Component
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer{
@Value("${allowedOrigins}")
private String allowedOrigins;
@Override
public void addCorsMappings(@NonNull CorsRegistry registry){
registry.addMapping("/**")
.allowedOriginPatterns("http://localhost:3000");
.allowedOriginPatterns(allowedOrigins);
}
}

View File

@@ -0,0 +1,27 @@
{
"groups":[
],
"properties":[
{
"name": "allowed-origins",
"type": "java.lang.String",
"description": "Allowed CORS origins",
"defaultValue": "http://localhost:3000"
}
],
"hints":[
{
"name": "allowed-origins",
"values": [
{
"value": "http://localhost:3000",
"description": "Local development"
},
{
"value": "https://api.cipherstream.mattrixwv.com",
"description": "Production"
}
]
}
]
}

View File

@@ -1 +1,2 @@
server.port=8001
allowedOrigins=http://localhost:3000