Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 4.31 KB

README.md

File metadata and controls

57 lines (42 loc) · 4.31 KB

Owin Sample with F#

It can be hosted in either IIS or as a Self-Host app. You can use this project as a template or reference for creating server-side portion of a single-page application (SPA).

F# Owin Sample Project

For more information, visit: Getting Started with OWIN and Katana

OWIN Startup (startup.fs)

namespace Server

open Owin
open Microsoft.Owin

type Startup() =
    member x.Configuration(app: Owin.IAppBuilder) =
        app.Run(fun ctx ->
            ctx.Response.ContentType <- "text/plain"
            ctx.Response.WriteAsync("Owin Sample with F#")
        ) |> ignore

[<assembly: OwinStartup(typeof<Startup>)>]
do ()

You can plug SignalR and/or Nancy framework into this class and start from there. And the front-end part of the SPA can be developed in a separate project and hosted in CDN (ex.: angular-seed).

Also see: Owin Startup Class Detection

Project settings for local debugging

OwinHost

  <PropertyGroup>
    ...
    <StartProgram>$(SolutionDir)packages\OwinHost.3.0.0-beta1\tools\OwinHost.exe</StartProgram>
    <StartArguments>-d "$(ProjectDir)"</StartArguments>
  </PropertyGroup>

Project settings for web publishing

  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>
  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />