Fix port binding (#31)
All checks were successful
Game Ideas deploy / build-test-deploy (push) Successful in 1m47s
All checks were successful
Game Ideas deploy / build-test-deploy (push) Successful in 1m47s
Reviewed-on: #31
This commit was merged in pull request #31.
This commit is contained in:
@@ -6,6 +6,7 @@ using GameIdeas.BlazorApp.Pages.UserMenu.Gateways;
|
|||||||
using GameIdeas.BlazorApp.Pages.Users.Gateways;
|
using GameIdeas.BlazorApp.Pages.Users.Gateways;
|
||||||
using GameIdeas.BlazorApp.Services;
|
using GameIdeas.BlazorApp.Services;
|
||||||
using GameIdeas.Resources;
|
using GameIdeas.Resources;
|
||||||
|
using GameIdeas.Shared.Constants;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
using Microsoft.AspNetCore.Components.Web;
|
||||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||||
@@ -19,9 +20,9 @@ builder.RootComponents.Add<HeadOutlet>("head::after");
|
|||||||
UriBuilder uriBuilder = new(builder.HostEnvironment.BaseAddress);
|
UriBuilder uriBuilder = new(builder.HostEnvironment.BaseAddress);
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
{
|
uriBuilder.Port = GlobalConstants.API_PORT;
|
||||||
uriBuilder.Port = 8000;
|
#else
|
||||||
}
|
uriBuilder.Host = GlobalConstants.SUB_DOMAIN_NAME + uriBuilder.Host;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
services.AddHttpClient(
|
services.AddHttpClient(
|
||||||
|
|||||||
@@ -17,5 +17,8 @@ public class GlobalConstants
|
|||||||
public const int NUMBER_PER_PAGE = 50;
|
public const int NUMBER_PER_PAGE = 50;
|
||||||
|
|
||||||
public const string LS_AUTH_STORAGE_KEY = "authToken";
|
public const string LS_AUTH_STORAGE_KEY = "authToken";
|
||||||
|
|
||||||
|
public const int API_PORT = 8000;
|
||||||
|
public const string SUB_DOMAIN_NAME = "api-";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using GameIdeas.Resources;
|
using GameIdeas.Resources;
|
||||||
|
using GameIdeas.Shared.Constants;
|
||||||
using GameIdeas.Shared.Model;
|
using GameIdeas.Shared.Model;
|
||||||
using GameIdeas.WebAPI.Context;
|
using GameIdeas.WebAPI.Context;
|
||||||
using GameIdeas.WebAPI.Services.Categories;
|
using GameIdeas.WebAPI.Services.Categories;
|
||||||
@@ -93,6 +94,8 @@ services.AddCors(option => option.AddDefaultPolicy(policy =>
|
|||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.WithMethods("GET", "POST", "PUT", "DELETE")));
|
.WithMethods("GET", "POST", "PUT", "DELETE")));
|
||||||
|
|
||||||
|
builder.WebHost.UseUrls($"http://127.0.0.1:{GlobalConstants.API_PORT}");
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
using (var scope = app.Services.CreateScope())
|
using (var scope = app.Services.CreateScope())
|
||||||
|
|||||||
Reference in New Issue
Block a user