aboutsummaryrefslogtreecommitdiffstats
path: root/code/api
diff options
context:
space:
mode:
Diffstat (limited to 'code/api')
-rw-r--r--code/api/I2R.Storage.Api.csproj14
-rw-r--r--code/api/Program.cs20
-rw-r--r--code/api/Properties/launchSettings.json25
3 files changed, 59 insertions, 0 deletions
diff --git a/code/api/I2R.Storage.Api.csproj b/code/api/I2R.Storage.Api.csproj
new file mode 100644
index 0000000..ce90fce
--- /dev/null
+++ b/code/api/I2R.Storage.Api.csproj
@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+ <PropertyGroup>
+ <TargetFramework>net7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <ImplicitUsings>enable</ImplicitUsings>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.0" />
+ <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
+ </ItemGroup>
+
+</Project>
diff --git a/code/api/Program.cs b/code/api/Program.cs
new file mode 100644
index 0000000..1b0b1b5
--- /dev/null
+++ b/code/api/Program.cs
@@ -0,0 +1,20 @@
+var builder = WebApplication.CreateBuilder(args);
+
+builder.Services.AddControllers();
+builder.Services.AddEndpointsApiExplorer();
+builder.Services.AddSwaggerGen();
+
+var app = builder.Build();
+
+if (app.Environment.IsDevelopment())
+{
+ app.UseSwagger();
+ app.UseSwaggerUI();
+}
+
+
+app.UseAuthorization();
+
+app.MapControllers();
+
+app.Run();
diff --git a/code/api/Properties/launchSettings.json b/code/api/Properties/launchSettings.json
new file mode 100644
index 0000000..778fa45
--- /dev/null
+++ b/code/api/Properties/launchSettings.json
@@ -0,0 +1,25 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": false,
+ "launchUrl": "swagger",
+ "applicationUrl": "http://localhost:5068",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": false,
+ "launchUrl": "swagger",
+ "applicationUrl": "https://localhost:7291;http://localhost:5068",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ }
+}