| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Thanks to the simplicity, elegance, strong typing and philosophy of both solutions, FSharp and ServiceStack are quickly becoming a popular choice for creating friction-less REST and message-based remote services.
open System
open ServiceStack
type Hello = { mutable Name: string; }
type HelloResponse = { mutable Result: string; }
type HelloService() =
interface IService
member this.Any (req:Hello) = { Result = "Hello, " + req.Name }
//Define the Web Services AppHost
type AppHost =
inherit AppSelfHostBase
new() = { inherit AppSelfHostBase("Hi F#!", typeof<HelloService>.Assembly) }
override this.Configure container =
base.Routes
.Add<Hello>("/hello")
.Add<Hello>("/hello/{Name}") |> ignore
//Run it!
[<EntryPoint>]
let main args =
let host = if args.Length = 0 then "http://*:1337/" else args.[0]
printfn "listening on %s ..." host
let appHost = new AppHost()
appHost.Init() |> ignore
appHost.Start host |> ignore
Console.ReadLine() |> ignore
0Getting Started
Designing APIs
Reference
Clients
Formats
View Engines 4. Razor & Markdown Razor
Hosts
Security
Advanced
Caching
HTTP Caching 1. CacheResponse Attribute 2. Cache Aware Clients
Auto Query
AutoQuery Data 1. AutoQuery Memory 2. AutoQuery Service 3. AutoQuery DynamoDB
Server Events
Service Gateway
Encrypted Messaging
Plugins
Tests
ServiceStackVS
Other Languages
Amazon Web Services
Deployment
Install 3rd Party Products
Use Cases
Performance
Other Products
Future
| Back | FazBrowse Home | New Git URL |