Skip to content

Instantly share code, notes, and snippets.

@ptmt
Last active May 21, 2017 22:58
Show Gist options
  • Save ptmt/6035260 to your computer and use it in GitHub Desktop.
Save ptmt/6035260 to your computer and use it in GitHub Desktop.
owin self-hosted blank project in F#

#first option

virtualize clean last ubuntu 13.04

  1. install git sudo apt-get install git and configure it git config --global user.name "Name" && git config --global user.email "unknownliveid@hotmail.com" , add id_rsa.pub to github
  2. install mono and monodevelop sudo apt-get install monodevelop
  3. install fsharp http://fsharp.org/use/linux/ and fsharp binding for monodevelop'
  4. install nuget addin https://github.com/mrward/monodevelop-nuget-addin

#second option

Vagrant + Virtual Box + puppet-mono https://github.com/haf/puppet-mono + Visual Studio as usual http://christoph.ruegg.name/blog/test-csharp-fsharp-on-mono-with-vagrant.html

Jenkins https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu

Configure Nginx (add jenkins to /etc/nginx/sites-avaibile with proxy to 8080)

Install Github oAuth Plugin https://wiki.jenkins-ci.org/display/JENKINS/Github+OAuth+Plugin

Install Github Plugin https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Plugin

Run Bootstrap (mono) from repository. MSBuild configure and install http://2.bp.blogspot.com/-WTZdj5-tOJU/UPGIKEyKOaI/AAAAAAAAGO0/Qojw9UF4LdU/s1600/jenkins3.png

http://blog.bekijkhet.com/2013/01/create-mono-c-buildserver-using-jenkins.html

<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Owin" version="1.1.0-beta2" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="1.1.0-beta2" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="Owin.Extensions" version="0.8.5" targetFramework="net45" />
<package id="Owin.Types" version="0.8.5" targetFramework="net45" />
</packages>
module WebServer
open System
open Microsoft.Owin.Hosting
[<EntryPoint>]
let main argv =
let baseAddress = "http://localhost:8888";
use a = Microsoft.Owin.Hosting.WebApp.Start<Startup.Startup>(baseAddress)
Console.WriteLine("Server running on {0}", baseAddress)
Console.ReadLine() |> ignore
0
module Startup
open Owin
open System.Web.Http
type public Startup() = class
member x.Configuration (app:IAppBuilder) =
app.UseHandlerAsync (StartupExtensions.OwinHandlerAsync(
fun req res -> res.WriteAsync("Hello, world!")
)) |> ignore
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment