Skip to content

Commit d8d8750

Browse files
committed
initial project and solution setup
0 parents  commit d8d8750

File tree

9 files changed

+257
-0
lines changed

9 files changed

+257
-0
lines changed

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
*.swp
2+
*.*~
3+
project.lock.json
4+
.DS_Store
5+
*.pyc
6+
nupkg/
7+
8+
# Visual Studio Code
9+
.vscode/*
10+
!.vscode/settings.json
11+
!.vscode/tasks.json
12+
!.vscode/launch.json
13+
!.vscode/extensions.json
14+
15+
# Rider
16+
.idea
17+
18+
# User-specific files
19+
*.suo
20+
*.user
21+
*.userosscache
22+
*.sln.docstates
23+
24+
# Build results
25+
[Dd]ebug/
26+
[Dd]ebugPublic/
27+
[Rr]elease/
28+
[Rr]eleases/
29+
x64/
30+
x86/
31+
build/
32+
bld/
33+
[Bb]in/
34+
[Oo]bj/
35+
[Oo]ut/
36+
msbuild.log
37+
msbuild.err
38+
msbuild.wrn
39+
40+
# Visual Studio 2015
41+
.vs/

Microservices.Sample.sln

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26124.0
5+
MinimumVisualStudioVersion = 15.0.26124.0
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9824AE51-13C7-4E94-8017-658A12929743}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StronglyTyped.SampleService", "src\StronglyTyped.SampleService\StronglyTyped.SampleService.csproj", "{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Debug|x64 = Debug|x64
14+
Debug|x86 = Debug|x86
15+
Release|Any CPU = Release|Any CPU
16+
Release|x64 = Release|x64
17+
Release|x86 = Release|x86
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
23+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Debug|x64.ActiveCfg = Debug|Any CPU
26+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Debug|x64.Build.0 = Debug|Any CPU
27+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Debug|x86.ActiveCfg = Debug|Any CPU
28+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Debug|x86.Build.0 = Debug|Any CPU
29+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Release|x64.ActiveCfg = Release|Any CPU
32+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Release|x64.Build.0 = Release|Any CPU
33+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Release|x86.ActiveCfg = Release|Any CPU
34+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683}.Release|x86.Build.0 = Release|Any CPU
35+
EndGlobalSection
36+
GlobalSection(NestedProjects) = preSolution
37+
{BFFC42DC-641E-4E00-9E2E-D5DDD26D7683} = {9824AE51-13C7-4E94-8017-658A12929743}
38+
EndGlobalSection
39+
EndGlobal
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
7+
namespace StronglyTyped.SampleService.Controllers
8+
{
9+
[Route("api/[controller]")]
10+
[ApiController]
11+
public class ValuesController : ControllerBase
12+
{
13+
// GET api/values
14+
[HttpGet]
15+
public ActionResult<IEnumerable<string>> Get()
16+
{
17+
return new string[] { "value1", "value2" };
18+
}
19+
20+
// GET api/values/5
21+
[HttpGet("{id}")]
22+
public ActionResult<string> Get(int id)
23+
{
24+
return "value";
25+
}
26+
27+
// POST api/values
28+
[HttpPost]
29+
public void Post([FromBody] string value)
30+
{
31+
}
32+
33+
// PUT api/values/5
34+
[HttpPut("{id}")]
35+
public void Put(int id, [FromBody] string value)
36+
{
37+
}
38+
39+
// DELETE api/values/5
40+
[HttpDelete("{id}")]
41+
public void Delete(int id)
42+
{
43+
}
44+
}
45+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore;
7+
using Microsoft.AspNetCore.Hosting;
8+
using Microsoft.Extensions.Configuration;
9+
using Microsoft.Extensions.Logging;
10+
11+
namespace StronglyTyped.SampleService
12+
{
13+
public class Program
14+
{
15+
public static void Main(string[] args)
16+
{
17+
CreateWebHostBuilder(args).Build().Run();
18+
}
19+
20+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21+
WebHost.CreateDefaultBuilder(args)
22+
.UseStartup<Startup>();
23+
}
24+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "http://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:61584",
8+
"sslPort": 44393
9+
}
10+
},
11+
"profiles": {
12+
"IIS Express": {
13+
"commandName": "IISExpress",
14+
"launchBrowser": true,
15+
"launchUrl": "api/values",
16+
"environmentVariables": {
17+
"ASPNETCORE_ENVIRONMENT": "Development"
18+
}
19+
},
20+
"StronglyTyped.SampleService": {
21+
"commandName": "Project",
22+
"launchBrowser": true,
23+
"launchUrl": "api/values",
24+
"applicationUrl": "https://localhost:5001;http://localhost:5000",
25+
"environmentVariables": {
26+
"ASPNETCORE_ENVIRONMENT": "Development"
27+
}
28+
}
29+
}
30+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Builder;
6+
using Microsoft.AspNetCore.Hosting;
7+
using Microsoft.AspNetCore.HttpsPolicy;
8+
using Microsoft.AspNetCore.Mvc;
9+
using Microsoft.Extensions.Configuration;
10+
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.Extensions.Logging;
12+
using Microsoft.Extensions.Options;
13+
14+
namespace StronglyTyped.SampleService
15+
{
16+
public class Startup
17+
{
18+
public Startup(IConfiguration configuration)
19+
{
20+
Configuration = configuration;
21+
}
22+
23+
public IConfiguration Configuration { get; }
24+
25+
// This method gets called by the runtime. Use this method to add services to the container.
26+
public void ConfigureServices(IServiceCollection services)
27+
{
28+
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
29+
}
30+
31+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
32+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
33+
{
34+
if (env.IsDevelopment())
35+
{
36+
app.UseDeveloperExceptionPage();
37+
}
38+
else
39+
{
40+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
41+
app.UseHsts();
42+
}
43+
44+
app.UseHttpsRedirection();
45+
app.UseMvc();
46+
}
47+
}
48+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.AspNetCore.App" />
10+
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
11+
</ItemGroup>
12+
13+
</Project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Debug",
5+
"System": "Information",
6+
"Microsoft": "Information"
7+
}
8+
}
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Warning"
5+
}
6+
},
7+
"AllowedHosts": "*"
8+
}

0 commit comments

Comments
 (0)