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.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay