$30 off During Our Annual Pro Sale. View Details »

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.

Richard Tasker

July 02, 2019
Tweet

More Decks by Richard Tasker

Other Decks in Programming

Transcript

  1. Building HTTP APIs With Carter

    View Slide

  2. [email protected] @ritasker
    About Me

    DotNet Developer for 11yrs

    Pier 8 Software Ltd.

    HTTP APIs, Hypermedia,
    Microservices, RMQ, Dockernetes

    OSS Contributer & Maintainer

    https://richardtasker.co.uk

    View Slide

  3. Agenda

    Minimalist Web Frameworks

    Frameworks Vs Micro-Frameworks

    Introducing Carter

    Getting Started With Carter

    Features Of Carter

    Testing Your Modules
    [email protected] @ritasker

    View Slide

  4. require 'sinatra'
    get '/frank-says' do
    'Put this in your pipe & smoke it!'
    end
    [email protected] @ritasker

    View Slide

  5. [email protected] @ritasker

    View Slide


  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.

    [email protected] @ritasker

    View Slide

  7. Frameworks &
    Micro-
    Frameworks
    Whats the
    difference?
    What are
    the
    benefits?
    When to use
    a Micro-
    Framework?
    [email protected] @ritasker

    View Slide

  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
    [email protected] @ritasker

    View Slide

  9. [email protected] @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

    View Slide

  10. [email protected] @ritasker

    View Slide

  11. [email protected] @ritasker
    Recap

    2007, Sinatra was released

    Sinatra, inspired NancyFx

    Compared Frameworks & Micro-Frameworks

    Small & Flexible

    Micro-Frameworks need extending

    View Slide

  12. [email protected] @ritasker
    Introducing Carter

    View Slide

  13. [email protected] @ritasker
    Key Features

    Model Binding/Validation Fluent Validation


    Before/After hooks

    IStatusCodeHandler

    IResponseNegotiator

    Support for OpenAPI Specification

    View Slide

  14. Summary
    [email protected] @ritasker

    The history of minimalist frameworks

    Compared frameworks vs micro-frameworks

    Introduced Carter

    Extended Carter

    Tested our Carter modules

    View Slide

  15. [email protected] @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

    View Slide