Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit f3596c4

Browse files
Step 1 for projects Uno, Dos, and Tres complete
Hello, World?
1 parent 86ef2e6 commit f3596c4

File tree

12 files changed

+213
-0
lines changed

12 files changed

+213
-0
lines changed

src/1-AspNetCore-CSharp/App.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace Uno
2+
{
3+
using Microsoft.AspNetCore.Hosting;
4+
5+
public class App
6+
{
7+
public static void Main(string[] args)
8+
{
9+
using (var host = new WebHostBuilder().UseKestrel().UseStartup<Startup>().Build())
10+
{
11+
host.Run();
12+
}
13+
}
14+
}
15+
}

src/1-AspNetCore-CSharp/Startup.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace Uno
2+
{
3+
using Microsoft.AspNetCore.Builder;
4+
using Microsoft.AspNetCore.Http;
5+
using System.Threading.Tasks;
6+
7+
public class Startup
8+
{
9+
public void Configure(IApplicationBuilder app) =>
10+
app.Run(async context => await context.Response.WriteAsync("Hello World from ASP.NET Core"));
11+
}
12+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"buildOptions": {
3+
"debugType": "portable",
4+
"emitEntryPoint": true
5+
},
6+
"dependencies": {
7+
"Microsoft.AspNetCore.Owin": "1.0.0",
8+
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0"
9+
},
10+
"frameworks": {
11+
"netcoreapp1.0": {
12+
"dependencies": {
13+
"Microsoft.NETCore.App": {
14+
"type": "platform",
15+
"version": "1.0.1"
16+
}
17+
},
18+
"imports": "dnxcore50"
19+
}
20+
},
21+
"version": "1.0.0-*"
22+
}

src/2-Nancy-CSharp/App.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace Dos
2+
{
3+
using Microsoft.AspNetCore.Hosting;
4+
5+
public class App
6+
{
7+
public static void Main(string[] args)
8+
{
9+
using (var host = new WebHostBuilder().UseKestrel().UseStartup<Startup>().Build())
10+
{
11+
host.Run();
12+
}
13+
}
14+
}
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace Dos.Modules
2+
{
3+
using Nancy;
4+
5+
public class HomeModule : NancyModule
6+
{
7+
public HomeModule() : base()
8+
{
9+
Get("/", _ => "Hello World from Nancy C#");
10+
}
11+
}
12+
}

src/2-Nancy-CSharp/Startup.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace Dos
2+
{
3+
using Microsoft.AspNetCore.Builder;
4+
using Microsoft.AspNetCore.Hosting;
5+
using Nancy.Owin;
6+
7+
public class Startup
8+
{
9+
public void Configure(IApplicationBuilder app)
10+
{
11+
app.UseOwin(x => x.UseNancy());
12+
}
13+
}
14+
}

src/2-Nancy-CSharp/project.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"buildOptions": {
3+
"debugType": "portable",
4+
"emitEntryPoint": true
5+
},
6+
"dependencies": {
7+
"Microsoft.AspNetCore.Owin": "1.0.0",
8+
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
9+
"Nancy": "2.0.0-barneyrubble"
10+
},
11+
"frameworks": {
12+
"netcoreapp1.0": {
13+
"dependencies": {
14+
"Microsoft.NETCore.App": {
15+
"type": "platform",
16+
"version": "1.0.1"
17+
}
18+
},
19+
"imports": "dnxcore50"
20+
}
21+
},
22+
"version": "1.0.0-*"
23+
}

src/3-Nancy-FSharp/App.fs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Learn more about F# at http://fsharp.org
2+
namespace Tres
3+
4+
open Microsoft.AspNetCore.Builder
5+
open Microsoft.AspNetCore.Hosting
6+
open Nancy
7+
open Nancy.Owin
8+
9+
type Startup() =
10+
member this.Configure (app : IApplicationBuilder) =
11+
app.UseOwin (fun x -> x.UseNancy (fun x -> ()) |> ignore) |> ignore
12+
13+
module App =
14+
[<EntryPoint>]
15+
let main argv =
16+
use host = (new WebHostBuilder()).UseKestrel().UseStartup<Startup>().Build()
17+
host.Run()
18+
0

src/3-Nancy-FSharp/HomeModule.fs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Tres
2+
3+
open Nancy
4+
5+
type HomeModule() as this =
6+
inherit NancyModule()
7+
8+
do
9+
this.Get("/", fun _ -> "Hello World from Nancy F#")

src/3-Nancy-FSharp/project.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"buildOptions": {
3+
"debugType": "portable",
4+
"emitEntryPoint": true,
5+
"compilerName": "fsc",
6+
"compile": {
7+
"includeFiles": [
8+
"HomeModule.fs",
9+
"App.fs"
10+
]
11+
}
12+
},
13+
"dependencies": {
14+
"Microsoft.AspNetCore.Owin": "1.0.0",
15+
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
16+
"Nancy": "2.0.0-barneyrubble"
17+
},
18+
"frameworks": {
19+
"netcoreapp1.0": {
20+
"dependencies": {
21+
"Microsoft.NETCore.App": {
22+
"type": "platform",
23+
"version": "1.0.1"
24+
},
25+
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160831"
26+
}
27+
}
28+
},
29+
"tools": {
30+
"dotnet-compile-fsc":"1.0.0-preview2-*"
31+
},
32+
"version": "1.0.0-*"
33+
}

0 commit comments

Comments
 (0)