Building HTTP APIs With Carter

Building HTTP APIs With Carter

In 2007 Sinatra was debuted, a DSL, written in Ruby, for building websites, web services, and web applications.
This spawned a movement towards using a minimalistic approach to building web applications, and numerous "Micro-frameworks" were created.

What is a micro-framework?
Are there any benefits of using a micro-framework?
What are some examples of when it's right to use a microframework instead of a full framework for custom software development?

In this session, Richard will discuss the differences between frameworks and micro-frameworks.
Demonstrate the benefits of a micro-framework using Carter, a routing library for use with ASP.Net Core.
Richard will show you how to get up and running with Carter, go through some examples of how Carter could benefit your product.
You will also see how easy it is to test your Carter modules using Microsoft.AspNetCore.TestHost TestServer.

Carter enables you to build performant HTTP APIs quickly, giving you the ability to rapidly pivot your product if required.

Ad3967ce9151013b7a5d3908ed369ce0?s=128

Richard Tasker

July 02, 2019
Tweet

Transcript

  1. Building HTTP APIs With Carter

  2. richard@pier8software.co.uk @ritasker About Me • DotNet Developer for 11yrs •

    Pier 8 Software Ltd. • HTTP APIs, Hypermedia, Microservices, RMQ, Dockernetes • OSS Contributer & Maintainer • https://richardtasker.co.uk
  3. Agenda • Minimalist Web Frameworks • Frameworks Vs Micro-Frameworks •

    Introducing Carter • Getting Started With Carter • Features Of Carter • Testing Your Modules richard@pier8software.co.uk @ritasker
  4. require 'sinatra' get '/frank-says' do 'Put this in your pipe

    & smoke it!' end richard@pier8software.co.uk @ritasker
  5. richard@pier8software.co.uk @ritasker

  6. “ Nancy is a lightweight, low-ceremony, framework for building HTTP

    based services on .NET and Mono. The goal of the framework is to stay out of the way as much as possible and provide a super- duper-happy-path to all interactions. ” richard@pier8software.co.uk @ritasker
  7. Frameworks & Micro- Frameworks Whats the difference? What are the

    benefits? When to use a Micro- Framework? richard@pier8software.co.uk @ritasker
  8. Frameworks Micro-Frameworks • Is a collection of libraries • Provide

    everything you need • Rigid • Slower learning curve • Versitile • Is considered a library • Provide only the essentials • Flexible • Quick leaning curve • Specific richard@pier8software.co.uk @ritasker
  9. richard@pier8software.co.uk @ritasker Small Footprint Flexibility • Fast & efficent •

    Less boilerplate code • Simple maintainable • Quicker to learn • Start dev earlier • Provide the basics • Opt-in mentality • You choose the tools • Can pivot quicker
  10. richard@pier8software.co.uk @ritasker

  11. richard@pier8software.co.uk @ritasker Recap • 2007, Sinatra was released • Sinatra,

    inspired NancyFx • Compared Frameworks & Micro-Frameworks • Small & Flexible • Micro-Frameworks need extending
  12. richard@pier8software.co.uk @ritasker Introducing Carter

  13. richard@pier8software.co.uk @ritasker Key Features • Model Binding/Validation Fluent Validation –

    • Before/After hooks • IStatusCodeHandler • IResponseNegotiator • Support for OpenAPI Specification
  14. Summary richard@pier8software.co.uk @ritasker • The history of minimalist frameworks •

    Compared frameworks vs micro-frameworks • Introduced Carter • Extended Carter • Tested our Carter modules
  15. richard@pier8software.co.uk @ritasker Thanks For Listening https://github.com/ritasker/CarterDemos https://speakerdeck.com/ritasker/building-http-apis-with-carter https://github.com/CarterCommunity/Carter https://docs.microsoft.com/en-us/aspnet/core/fundamentals/ routing?view=aspnetcore-2.2