Skip to content

Web application server sample project with Owin / Katana and F#

License

Notifications You must be signed in to change notification settings

shrimpy/fsharp-owin-sample

 
 

Repository files navigation

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" />

About

Web application server sample project with Owin / Katana and F#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 98.5%
  • F# 1.5%