5 Days of Simple.Web: Getting Started

Getting started

Simple.Web is intended to be exactly that – Simple! Let’s see how easy it is to get started.

1. Create a new Console Project

Let’s create a console project to bootstrap our example. I’m using MonoDevelop here to show Simple.Web is just as fantastic on Mono as .NET. If you also want to use MonoDevelop then I’d recommend installing the NuGet add-in.

2. Install NuGet packages

I’m going to pick the new self-hosting package, it will bring in all the dependencies I need.

3. Bootstrap

4. Create a resource

For the sake of simplicity I have chosen not to return a model (and thus use content negotiation) and instead inherit Simple.Web “OutputBehaviour” IOutput<RawHtml> that will simple render the contents of the string into the response stream; together with a 200 OK HTTP response code we’re done!