This repository contains (almost) ready to run samples of Web services using the Giraffe library on F#. The goal is to show specific techniques in each sample rather than to create a big all-encompassing project, so far we've got:
- Simplest Sample, a bare-bones project with just two GET services:
- /ping which returns a pong text
- /ec which returns a simple JSON object on the body
- SQL Server with Dapper CRUD services, a quite elaborate sample with services for CRUD operations
- The services are implemented asynchronously using tasks
- The services uses the Dapper library to work against a SQL Server table
- The services return adequate HTTP status codes: OK, Created, NotFound, etc.
- The services uses a header token to authorize the calls
- In order for this example to work you must configure the appsettings.json file:
- Set the APIKey entry with your authorization token
- Set the DbConnectionString entry with your SQL Server connection string
- The SQL commands use the Products table of the AdventureWorksLT sample database
In the future we will adding other examples, some ideas:
- CRUD services with MongoDB
- CRUD services with Entity Framework
- Using OAuth tokens for call authorization
We are now using Giraffe 5.0, based on ASP.NET Core routing.
Suggestions and comments most welcomed!