Skip to content

Commit 9d9bc97

Browse files
committed
add suave sample
1 parent 7faaf01 commit 9d9bc97

File tree

13 files changed

+1056
-0
lines changed

13 files changed

+1056
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.fake/
2+
obj/
3+
bin/
4+
packages/
5+
paket-files/
6+
.vs/

fsharp/ModelBinding/SuaveSample/.paket/Paket.Restore.targets

Lines changed: 383 additions & 0 deletions
Large diffs are not rendered by default.
62.8 KB
Binary file not shown.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.27004.2009
4+
MinimumVisualStudioVersion = 15.0.26124.0
5+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2364C03F-7BCF-4E5A-9720-95991959E582}"
6+
EndProject
7+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SuaveSample", "src\SuaveSample\SuaveSample.fsproj", "{EF178058-7006-4ED9-8268-912C3638A81C}"
8+
EndProject
9+
Global
10+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
11+
Debug|Any CPU = Debug|Any CPU
12+
Debug|x64 = Debug|x64
13+
Debug|x86 = Debug|x86
14+
Release|Any CPU = Release|Any CPU
15+
Release|x64 = Release|x64
16+
Release|x86 = Release|x86
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{EF178058-7006-4ED9-8268-912C3638A81C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{EF178058-7006-4ED9-8268-912C3638A81C}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{EF178058-7006-4ED9-8268-912C3638A81C}.Debug|x64.ActiveCfg = Debug|Any CPU
22+
{EF178058-7006-4ED9-8268-912C3638A81C}.Debug|x64.Build.0 = Debug|Any CPU
23+
{EF178058-7006-4ED9-8268-912C3638A81C}.Debug|x86.ActiveCfg = Debug|Any CPU
24+
{EF178058-7006-4ED9-8268-912C3638A81C}.Debug|x86.Build.0 = Debug|Any CPU
25+
{EF178058-7006-4ED9-8268-912C3638A81C}.Release|Any CPU.ActiveCfg = Release|Any CPU
26+
{EF178058-7006-4ED9-8268-912C3638A81C}.Release|Any CPU.Build.0 = Release|Any CPU
27+
{EF178058-7006-4ED9-8268-912C3638A81C}.Release|x64.ActiveCfg = Release|Any CPU
28+
{EF178058-7006-4ED9-8268-912C3638A81C}.Release|x64.Build.0 = Release|Any CPU
29+
{EF178058-7006-4ED9-8268-912C3638A81C}.Release|x86.ActiveCfg = Release|Any CPU
30+
{EF178058-7006-4ED9-8268-912C3638A81C}.Release|x86.Build.0 = Release|Any CPU
31+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
33+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Debug|x64.ActiveCfg = Debug|x64
34+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Debug|x64.Build.0 = Debug|x64
35+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Debug|x86.ActiveCfg = Debug|x86
36+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Debug|x86.Build.0 = Debug|x86
37+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
38+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Release|Any CPU.Build.0 = Release|Any CPU
39+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Release|x64.ActiveCfg = Release|x64
40+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Release|x64.Build.0 = Release|x64
41+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Release|x86.ActiveCfg = Release|x86
42+
{99166CAE-99E9-4F34-A421-48C69C84CB4C}.Release|x86.Build.0 = Release|x86
43+
EndGlobalSection
44+
GlobalSection(SolutionProperties) = preSolution
45+
HideSolutionNode = FALSE
46+
EndGlobalSection
47+
GlobalSection(NestedProjects) = preSolution
48+
{EF178058-7006-4ED9-8268-912C3638A81C} = {2364C03F-7BCF-4E5A-9720-95991959E582}
49+
{99166CAE-99E9-4F34-A421-48C69C84CB4C} = {2364C03F-7BCF-4E5A-9720-95991959E582}
50+
EndGlobalSection
51+
GlobalSection(ExtensibilityGlobals) = postSolution
52+
SolutionGuid = {9C5AE95E-71A9-4D06-A4E6-D49FDCCD27E1}
53+
EndGlobalSection
54+
EndGlobal
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@echo off
2+
cls
3+
4+
IF EXIST "paket.lock" (
5+
.paket\paket.exe restore
6+
) ELSE (
7+
.paket\paket.exe install
8+
)
9+
10+
if errorlevel 1 (
11+
exit /b %errorlevel%
12+
)
13+
14+
packages\build\FAKE\tools\FAKE.exe build.fsx %*
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#r @"packages/build/FAKE/tools/FakeLib.dll"
2+
3+
open System
4+
5+
open Fake
6+
7+
let appPath = "./src/SuaveSample/" |> FullName
8+
9+
let dotnetcliVersion = DotNetCli.GetDotNetSDKVersionFromGlobalJson()
10+
11+
Target "Clean" DoNothing
12+
13+
Target "InstallDotNetCore" (fun _ ->
14+
DotNetCli.InstallDotNetSDK dotnetcliVersion |> ignore
15+
)
16+
17+
18+
Target "Restore" (fun _ ->
19+
DotNetCli.Restore (fun p -> {p with WorkingDir = appPath})
20+
)
21+
22+
Target "Build" (fun _ ->
23+
DotNetCli.Build(fun p -> {p with WorkingDir = appPath})
24+
)
25+
26+
Target "Run" (fun () ->
27+
let server = async {
28+
DotNetCli.RunCommand (fun p -> {p with WorkingDir = appPath}) "watch run"
29+
}
30+
let browser = async {
31+
Threading.Thread.Sleep 5000
32+
Diagnostics.Process.Start "http://localhost:8085" |> ignore
33+
}
34+
35+
[ server; browser]
36+
|> Async.Parallel
37+
|> Async.RunSynchronously
38+
|> ignore
39+
)
40+
41+
"Clean"
42+
==> "InstallDotNetCore"
43+
==> "Build"
44+
45+
"Clean"
46+
==> "Restore"
47+
==> "Run"
48+
49+
RunTargetOrDefault "Build"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
cd "$(dirname "$0")"
6+
7+
PAKET_EXE=.paket/paket.exe
8+
FAKE_EXE=packages/build/FAKE/tools/FAKE.exe
9+
10+
FSIARGS=""
11+
FSIARGS2=""
12+
OS=${OS:-"unknown"}
13+
if [ "$OS" != "Windows_NT" ]
14+
then
15+
# Can't use FSIARGS="--fsiargs -d:MONO" in zsh, so split it up
16+
# (Can't use arrays since dash can't handle them)
17+
FSIARGS="--fsiargs"
18+
FSIARGS2="-d:MONO"
19+
fi
20+
21+
run() {
22+
if [ "$OS" != "Windows_NT" ]
23+
then
24+
mono "$@"
25+
else
26+
"$@"
27+
fi
28+
}
29+
30+
echo "Executing Paket..."
31+
32+
FILE='paket.lock'
33+
if [ -f $FILE ]; then
34+
echo "paket.lock file found, restoring packages..."
35+
run $PAKET_EXE restore
36+
else
37+
echo "paket.lock was not found, installing packages..."
38+
run $PAKET_EXE install
39+
fi
40+
41+
run $FAKE_EXE "$@" $FSIARGS $FSIARGS2 build.fsx
42+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "2.1.4"
4+
}
5+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
source https://api.nuget.org/v3/index.json
2+
3+
nuget FSharp.Core
4+
nuget Suave
5+
nuget FsConfig
6+
7+
group Build
8+
source https://api.nuget.org/v3/index.json
9+
10+
nuget FAKE

0 commit comments

Comments
 (0)