Skip to content

Commit eb8907a

Browse files
SverrevgJeapfromtheLakeEGKangarooGompel,Sverre S. vanHeesakkers,Aron A.P.H.M
authored
Merge master in develop (#27)
* Develop into master (#26) * Task/#257 controller skeleton * Task/#263 koppeling pakket service * cors (#5) * dockerfile added local file * Add license (#6) * Update README.md * Create LICENSE * Update README.md Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl> * Build (#11) Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl> * Hardcoded values to appsettings (#12) Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl> * Update README.md (#13) * Develop (#7) * Task/#257 controller skeleton * Task/#263 koppeling pakket service * cors (#5) * dockerfile added local file * Add license (#6) * Update README.md * Create LICENSE * Update README.md Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl> Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl> Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl> Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl> Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com> * Update README.md Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl> Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl> Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl> Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com> * Update README.md * Gateway fix (#16) * Changes * gateway fix, same request model as package service * created at action bug fixed Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl> Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com> * Task/#264 koppeling locatieservice (#18) * added locationservice url * added models * location controller * fixed room requestmodel * fix endpoints and constants * more model fixes * getpackage conversion fix * Story/#333 pakketgegevens (#20) * personeel-service toegevoegd * start error handling. persoon toegevoegd aan GetPackage(id) * sender is receiverid bugfix * collectionpoint ophalen bij GetPackage{id} * 400 - 404 errors allowed. getpackages haalt nu ook locatie en ontvanger op * merge fix * Story/#16 edit locations (#23) * Docker Local Appsettings * README update * Update methods finished * Changed name Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl> * #358 delete endpoints (#24) * all calls make use of flurl extension and return ObjectResults * Delete endpoints toegevoegd aan locatiecontroller * Error handling voor delete endpoints * conflict httpstatus added * Small formatting fix in locatiecontroller Co-authored-by: JaapvanderMeer <43168682+JeapfromtheLake@users.noreply.github.com> Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl> Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl> Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl> Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com> Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com> Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl> Co-authored-by: Sverre <43172180+Sverrevg@users.noreply.github.com> * Update docker-publish.yml * Update appsettings.json * Update appsettings.json * Rename appsettings.Docker.json to tmp * Rename tmp to appsettings.Docker.json * Add kestral * gethealth call Co-authored-by: Jaap van der Meer <43168682+JeapfromtheLake@users.noreply.github.com> Co-authored-by: Wieling,Kevin C.F.J <k.wieling@student.fontys.nl> Co-authored-by: Gompel,Sverre S. van <sverre.vangompel@student.fontys.nl> Co-authored-by: Heesakkers,Aron A.P.H.M <aron.heesakkers@student.fontys.nl> Co-authored-by: EGKangaroo <EGKangaroo@yahoo.com> Co-authored-by: Shady^ <36726909+ShadyDL@users.noreply.github.com> Co-authored-by: Aron Heesakkers <aron.heesakkers@via.nl>
1 parent 58e2805 commit eb8907a

File tree

5 files changed

+40
-5
lines changed

5 files changed

+40
-5
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
files: 'appsettings.json'
2020
env:
2121
PackageApiUrl: "${{ secrets.PAKKET_URL }}"
22+
PersonApiUrl: "${{ secrets.PERSON_URL }}"
2223
LocationApiUrl: "${{ secrets.LOCATION_URL }}"
2324

2425
- name: Push to Docker Hub

Controllers/PersonController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,11 @@ public async Task<ActionResult<PersonServiceModel>> GetPersonById(string id)
7070
PersonServiceModel responseModel = await flurlResponse.GetJsonAsync<PersonServiceModel>();
7171
return Ok(responseModel);
7272
}
73+
74+
[HttpGet("health")]
75+
public ActionResult Health()
76+
{
77+
return Ok();
78+
}
7379
}
7480
}

Program.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
using System.Linq;
44
using System.Threading.Tasks;
55
using Microsoft.AspNetCore.Hosting;
6+
using Microsoft.AspNetCore.Server.Kestrel.Core;
67
using Microsoft.Extensions.Configuration;
8+
using Microsoft.Extensions.DependencyInjection;
79
using Microsoft.Extensions.Hosting;
810
using Microsoft.Extensions.Logging;
911

@@ -18,10 +20,32 @@ public static void Main(string[] args)
1820

1921
public static IHostBuilder CreateHostBuilder(string[] args) =>
2022
Host.CreateDefaultBuilder(args)
21-
.ConfigureWebHostDefaults(webBuilder =>
23+
24+
.ConfigureServices((context, services) =>
25+
{
26+
services.Configure<KestrelServerOptions>(
27+
context.Configuration.GetSection("Kestrel"));
28+
})
29+
.ConfigureWebHostDefaults(webBuilder =>
30+
{
31+
webBuilder.ConfigureKestrel(serverOptions =>
2232
{
23-
webBuilder.UseStartup<Startup>()
24-
.UseUrls("http://*:8123");
25-
});
33+
serverOptions.Limits.MaxConcurrentConnections = 100;
34+
serverOptions.Limits.MaxConcurrentUpgradedConnections = 100;
35+
serverOptions.Limits.MaxRequestBodySize = 10 * 1024;
36+
serverOptions.Limits.MinRequestBodyDataRate =
37+
new MinDataRate(bytesPerSecond: 100,
38+
gracePeriod: TimeSpan.FromSeconds(10));
39+
serverOptions.Limits.MinResponseDataRate =
40+
new MinDataRate(bytesPerSecond: 100,
41+
gracePeriod: TimeSpan.FromSeconds(10));
42+
serverOptions.Limits.KeepAliveTimeout =
43+
TimeSpan.FromDays(30);
44+
serverOptions.Limits.RequestHeadersTimeout =
45+
TimeSpan.FromDays(30);
46+
})
47+
.UseStartup<Startup>()
48+
.UseUrls("http://*:8123");
49+
});
2650
}
2751
}

Startup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.AspNetCore.Hosting;
99
using Microsoft.AspNetCore.HttpsPolicy;
1010
using Microsoft.AspNetCore.Mvc;
11+
using Microsoft.AspNetCore.Server.Kestrel.Core;
1112
using Microsoft.Extensions.Configuration;
1213
using Microsoft.Extensions.DependencyInjection;
1314
using Microsoft.Extensions.Hosting;
@@ -29,6 +30,9 @@ public Startup(IConfiguration configuration)
2930
// This method gets called by the runtime. Use this method to add services to the container.
3031
public void ConfigureServices(IServiceCollection services)
3132
{
33+
services.Configure<KestrelServerOptions>(
34+
Configuration.GetSection("Kestrel"));
35+
3236
Constants.PackageApiUrl = Configuration.GetValue<string>("PackageApiUrl");
3337
Constants.LocationApiUrl = Configuration.GetValue<string>("LocationApiUrl");
3438
Constants.PersonApiUrl = Configuration.GetValue<string>("PersonApiUrl");

appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"AllowedHosts": "*",
1010
"PackageApiUrl": "",
1111
"LocationApiUrl": "",
12-
"PersonApiUrl": ""
12+
"PersonApiUrl": ""
1313
}

0 commit comments

Comments
 (0)