├── .gitignore
├── NuGet.Config
├── Program.fs
├── README.md
├── manifest.yml
└── project.json
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 | *.lock.json
4 | *.xproj
5 | *.user
6 | *.sln
7 | .vs
8 |
--------------------------------------------------------------------------------
/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Program.fs:
--------------------------------------------------------------------------------
1 | open System
2 | open Microsoft.AspNetCore.Hosting
3 | open Microsoft.AspNetCore.Builder
4 | open Microsoft.AspNetCore.Hosting
5 | open Microsoft.AspNetCore.Http
6 | open Microsoft.Extensions.Configuration
7 | open Microsoft.Extensions.Configuration.CommandLine
8 | open Microsoft.Extensions.Configuration.EnvironmentVariables
9 |
10 |
11 | type Startup() =
12 | member this.Configure(app: IApplicationBuilder) =
13 | app.Run(fun context -> context.Response.WriteAsync("Hello from ASP.NET Core!"))
14 |
15 |
16 | []
17 | let main argv =
18 | let config = ConfigurationBuilder().AddCommandLine(argv).AddEnvironmentVariables().Build()
19 | let host = WebHostBuilder().UseKestrel().UseConfiguration(config).UseStartup().Build()
20 | host.Run()
21 | printfn "Server finished!"
22 | 0
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Notes
2 |
3 | * Modified to accept command line and environment variables to be deployable to PCF
4 | * When pushing to PCF, you'll have to use more disk than 1GB. In my tests, this sample consumes close enough to 1GB that there isn't enough space to push the droplet and run it.
5 |
6 | Minimal demo of ASP.NET Core F# app
7 |
8 | Just perform these commands:
9 |
10 | dotnet restore
11 | dotnet run
12 |
--------------------------------------------------------------------------------
/manifest.yml:
--------------------------------------------------------------------------------
1 | ---
2 | applications:
3 | - name: fsharp-demo
4 | memory: 1512M
5 | disk: 2G
6 | buildpack: https://github.com/cloudfoundry-incubator/dotnet-core-buildpack.git
7 | command: dotnet run --server.urls=http://0.0.0.0:$PORT
8 | env:
9 | CF_TRACE: true
10 |
--------------------------------------------------------------------------------
/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0.0-*",
3 | "buildOptions": {
4 | "emitEntryPoint": true,
5 | "compilerName": "fsc",
6 | "compile": "**/*.fs"
7 | },
8 | "dependencies": {
9 | "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160509",
10 | "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
11 | "Microsoft.AspNetCore.Http.Abstractions": "1.0.0",
12 | "Microsoft.AspNetCore.Hosting": "1.0.0" ,
13 | "Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
14 | "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0"
15 | },
16 | "tools": {
17 | "dotnet-compile-fsc": {
18 | "version": "1.0.0-preview2-*",
19 | "imports": [
20 | "dnxcore50",
21 | "portable-net45+win81",
22 | "netstandard1.3"
23 | ]
24 | }
25 | },
26 | "frameworks": {
27 | "netcoreapp1.0": {
28 | "dependencies": {
29 | "Microsoft.NETCore.App": {
30 | "type": "platform",
31 | "version": "1.0.0"
32 | }
33 | },
34 | "imports": [
35 | "dnxcore50"
36 | ]
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------