Hi I just publish asp.net core API to IIS Server and i want my programmer to use this service to testing and development angular app for design layout on clients side It is possible and how can set this setting
Thank you
6 Answer(s)
-
0
You can set it here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/assets/appconfig.json#L2">https://github.com/aspnetzero/aspnet-ze ... ig.json#L2</a>
-
0
<cite>ismcagdas: </cite> You can set it here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/assets/appconfig.json#L2">https://github.com/aspnetzero/aspnet-ze ... ig.json#L2</a>
Hi i still cannot get my angular app to work after i change aspnet-zero-core/angular/src/assets/appconfig.json
{ "remoteServiceBaseUrl": "http://192.168.100.99:2500", "appBaseUrl": "http://localhost:4200", "localeMappings": [ { "from": "pt-BR", "to": "pt" }, { "from": "zh-CN", "to": "zh" }, { "from": "he-IL", "to": "he" } ] }
after i open chrome browser to test on development time the error show this
Failed to load <a class="postlink" href="http://192.168.100.99:2500/AbpUserConfiguration/GetAll">http://192.168.100.99:2500/AbpUserConfiguration/GetAll</a>: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
how can i solve with this issue Thank you
-
0
Check Logs.txt file of the app running on <a class="postlink" href="http://192.168.100.99:2500">http://192.168.100.99:2500</a> to see if there are any error messages.
-
0
<cite>ismcagdas: </cite> Check Logs.txt file of the app running on <a class="postlink" href="http://192.168.100.99:2500">http://192.168.100.99:2500</a> to see if there are any error messages.
Hi i already see the error on Logs.txt
INFO 2018-07-30 10:16:22,121 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS <a class="postlink" href="http://192.168.100.99:2500/AbpUserConfiguration/GetAll">http://192.168.100.99:2500/AbpUserConfiguration/GetAll</a>
INFO 2018-07-30 10:16:22,121 [8 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution failed. INFO 2018-07-30 10:16:22,121 [8 ] pNetCore.Cors.Infrastructure.CorsService - Request origin <a class="postlink" href="http://localhost:4200">http://localhost:4200</a> does not have permission to access the resource. INFO 2018-07-30 10:16:22,121 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 0.373ms 204 INFO 2018-07-30 10:17:06,191 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS <a class="postlink" href="http://192.168.100.99:2500/AbpUserConfiguration/GetAll">http://192.168.100.99:2500/AbpUserConfiguration/GetAll</a>
INFO 2018-07-30 10:17:06,191 [8 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution failed. INFO 2018-07-30 10:17:06,191 [8 ] pNetCore.Cors.Infrastructure.CorsService - Request origin <a class="postlink" href="http://192.168.100.108:4200">http://192.168.100.108:4200</a> does not have permission to access the resource. INFO 2018-07-30 10:17:06,191 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 0.3659ms 204how can i config to allow this client on development time to access and use this api service
Thank you
-
0
Hi i just solve this issue by adding my clients ip address that can access to appsettings.production.json on my API site
"CorsOrigins": "http://localhost:4200, <a class="postlink" href="http://192.168.100.108:4200">http://192.168.100.108:4200</a>"
Thank you
-
0
thanks for your feedback