aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorOgnjen Cirkovic <ciraboxkg@gmail.com>2022-04-16 18:36:22 +0200
committerOgnjen Cirkovic <ciraboxkg@gmail.com>2022-04-16 18:36:22 +0200
commit717e15a9e0d35148a3cb0015b4b11b3abd291390 (patch)
treea370229abc3ad5a85626f5aee3e4bce67157633b /backend
parente8db6c2081155f9c4fed7c8a06e37e89a7398101 (diff)
Updajtovan Cors. Sve se uzima iz konfiguracionog fajla
Diffstat (limited to 'backend')
-rw-r--r--backend/api/api/Program.cs5
-rw-r--r--backend/api/api/Properties/launchSettings.json46
-rw-r--r--backend/api/api/appsettings.json41
3 files changed, 43 insertions, 49 deletions
diff --git a/backend/api/api/Program.cs b/backend/api/api/Program.cs
index 576093fe..71509b38 100644
--- a/backend/api/api/Program.cs
+++ b/backend/api/api/Program.cs
@@ -64,11 +64,12 @@ builder.Services.Configure<FormOptions>(x =>
builder.Services.AddSignalR();
builder.Services.AddControllers();
-
+string frontApi = builder.Configuration.GetValue<string>("AppSettings:FrontApi");
+string mlApi = builder.Configuration.GetValue<string>("AppSettings:MlApi");
builder.Services.AddCors(options =>
{
options.AddPolicy("CorsPolicy", builder => builder
- .WithOrigins("http://localhost:4200")
+ .WithOrigins(frontApi, mlApi)
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
diff --git a/backend/api/api/Properties/launchSettings.json b/backend/api/api/Properties/launchSettings.json
index 5c9dd2a8..f6c3fe8b 100644
--- a/backend/api/api/Properties/launchSettings.json
+++ b/backend/api/api/Properties/launchSettings.json
@@ -1,31 +1,23 @@
{
- "$schema": "https://json.schemastore.org/launchsettings.json",
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:61918",
- "sslPort": 0
- }
- },
- "profiles": {
- "api": {
- "commandName": "Project",
- "dotnetRunMessages": true,
- "launchBrowser": false,
- "launchUrl": "",
- "applicationUrl": "http://localhost:5283",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:61918",
+ "sslPort": 0
+ }
},
- "IIS Express": {
- "commandName": "IISExpress",
- "launchBrowser": false,
- "launchUrl": "",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
+ "profiles": {
+ "api": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": false,
+ "launchUrl": "",
+ "applicationUrl": "http://localhost:5283",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
}
- }
}
diff --git a/backend/api/api/appsettings.json b/backend/api/api/appsettings.json
index 42f62b75..e96549a8 100644
--- a/backend/api/api/appsettings.json
+++ b/backend/api/api/appsettings.json
@@ -1,27 +1,28 @@
{
"AppSettings": {
"JwtToken": "2mnttqPtRb4GIWHFtagm",
- "MlApi": "http://127.0.0.1:5543"
+ "MlApi": "http://127.0.0.1:5543",
+ "FrontApi": "http://localhost:4200"
},
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "Microsoft.AspNetCore": "Warning"
- }
- },
- "AllowedHosts": "*",
- "UserStoreDatabaseSettings": {
- /* LocalHost*/
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*",
+ "UserStoreDatabaseSettings": {
+ /* LocalHost*/
- "ConnectionString": "mongodb://127.0.0.1:27017/",
- "DatabaseName": "si_project",
- "CollectionName": "users",
- "DatasetCollectionName": "Dataset",
- "ModelCollectionName": "Model",
- "PredictorCollectionName": "Predictor",
- "FilesCollectionName": "Files",
- "ExperimentCollectionName": "Experiment"
- /*
+ "ConnectionString": "mongodb://127.0.0.1:27017/",
+ "DatabaseName": "si_project",
+ "CollectionName": "users",
+ "DatasetCollectionName": "Dataset",
+ "ModelCollectionName": "Model",
+ "PredictorCollectionName": "Predictor",
+ "FilesCollectionName": "Files",
+ "ExperimentCollectionName": "Experiment"
+ /*
"ConnectionString": "mongodb+srv://si_user:si_user@sidatabase.twtfm.mongodb.net/myFirstDatabase?retryWrites=true&w=majority",
"DatabaseName": "si_db",
"CollectionName": "users",
@@ -30,5 +31,5 @@
"PredictorCollectionName": "Predictor",
"FilesCollectionName": "Files",
"ExperimentCollectionName": "Experiment" */
- }
+ }
} \ No newline at end of file