Skip to content
/ ezra Public

A HTTP server built with TDD over the protocol specification

License

Notifications You must be signed in to change notification settings

hesenger/ezra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ezra

Ezra is a HTTP web server built based over the orinal protocol specification using TDD since the very beggining.

Ezra is a fully recreational project made for learning and not intended to be used in production.

Usage

using Ezra;

public static class Program
{
    public static void Main(string[] args)
    {
        new EzraServer()
            .MapHandler("/hello", new EchoHandler("hello"))
            .MapHandler("/ok", new EchoHandler("ok"))
            .Start(args);
    }
}

public class EchoHandler : IRequestHandler
{
    private readonly string _message;

    public EchoHandler(string message)
    {
        _message = message;
    }

    public void Handle(IRequest request, IResponse response)
    {
        System.Console.WriteLine($"{request.Method} {request.Path}");
        response.Write(_message);
    }
}

Development

The project was developed using NET 6 and VSCode in a Mac M1, so running it in a Windows/Visual Studio environment might require some tweaks.

Resources

About

A HTTP server built with TDD over the protocol specification

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages