Permalink
Browse files

Updated for CodeStock 2012

  • Loading branch information...
1 parent 0499ce6 commit b6329f0e4beeac569e2d9a323f6a050d7eec3da0 @dmohl committed May 31, 2012
Showing 3,112 changed files with 1,186,610 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>e2f04bf7-814a-4533-903b-55ebfd17a8eb</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>FrankServer</RootNamespace>
+ <AssemblyName>FrankServer</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <Name>FrankServer</Name>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <Tailcalls>false</Tailcalls>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <WarningLevel>3</WarningLevel>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DocumentationFile>bin\Debug\FrankServer.XML</DocumentationFile>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <Tailcalls>true</Tailcalls>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <WarningLevel>3</WarningLevel>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DocumentationFile>bin\Release\FrankServer.XML</DocumentationFile>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup>
+ <MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')" />
+ <ItemGroup>
+ <Compile Include="Program.fs" />
+ <None Include="App.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="Frank">
+ <HintPath>..\lib\Frank.dll</HintPath>
+ </Reference>
+ <Reference Include="FSharpx.Core">
+ <HintPath>..\packages\FSharpx.Core.1.5.49\lib\40\Fsharpx.Core.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="mscorlib" />
+ <Reference Include="FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference Include="System.Numerics" />
+ <Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference Include="System.Web.Http.SelfHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ </ItemGroup>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,42 @@
+open System
+open System.Net
+open System.Net.Http
+open System.Web.Http
+open System.Web.Http.SelfHost
+open Frank
+
+let values request =
+ respond HttpStatusCode.OK
+ <| new StringContent(["values1"; "values2"].ToString())
+ <| ignore
+ |> async.Return
+
+let value request =
+ let id = getParam request "id"
+ respond HttpStatusCode.OK
+ <| new StringContent(sprintf "The value is %s" id)
+ <| ignore
+ |> async.Return
+
+let delValue request =
+ new HttpResponseMessage() |> async.Return
+
+let app = merge [ route "/api/values" <| get values
+ route "/api/values/{id}" <| (get value <|> delete delValue)]
+ |> Middleware.log
+
+module HostServer =
+ let Main args =
+ let baseUri = "http://localhost:9393"
+ use config = new HttpSelfHostConfiguration(baseUri)
+ config.Register app
+
+ use server = new HttpSelfHostServer(config)
+ server.OpenAsync().Wait()
+
+ printfn "The service is running at %s..." baseUri
+ Console.ReadKey() |> ignore
+ server.CloseAsync().Wait()
+
+ Main ()
+
Binary file not shown.
Oops, something went wrong.

0 comments on commit b6329f0

Please sign in to comment.