DEV Community

Yasser Ameur el idrissi
Yasser Ameur el idrissi

Posted on

A powerful HTTP router and URL matcher for building Deno web servers with dragon🐉.

What I built

I built a simple, fast and low HTTP router and URL matcher for building Deno servers.

Category Submission:

framework, middleware, http-matcher, deno, server

App Link

https://github.com/xanny-projects/dragon

Screenshots

import { Application, RequestMethod, HttpRequest, HttpResponse } from "https://deno.land/x/dragon@v1.0.6/lib/mod.ts";

const app = new Application();

const r = app.routes({ maxRoutes:2 });

r.Path("/hello")
 .withMethods(RequestMethod.GET)
 .handleFunc(async function (Request: HttpRequest, ResponseWriter: HttpResponse) {
      ResponseWriter.withBody("Hello Dragon").send();
  });

r.Path("/demo")
 .HandleFunc(async function (Request: HttpRequest, ResponseWriter: HttpResponse) {
    ResponseWriter.withBody("Hello Dragon Demo").send();
  });

app.listenAndServe({ port: 8080 });
Enter fullscreen mode Exit fullscreen mode

Description

Dragon is a simple, fast and low HTTP router and URL matcher for building Deno servers. If you need performance and good productivity, you will love it.

Features

  • Developer friendly, very expressive and help the developer in their daily use, without sacrificing performance and security.
  • Lightweight and modular design allows for a flexible framework.
  • Focus on high performance.
  • Middleware support, incoming HTTP request can be handled by a chain of middlewares and the final action.
  • Excellent and fluent documentation.

Link to Source Code

https://github.com/xanny-projects/dragon

Permissive License

Apache-2.0 License

How I built it

(How did you utilize DigitalOcean’s App Platform? Did you learn something new along the way? Pick up a new skill?)
I have used DigitalOcean for the first time, I don't have much idea of other features that DigitalOcean provides but it was pretty easy to deploy the app and I really liked it.

Top comments (0)