paint-brush
An Introduction to the Xanny Frameworkby@getspooky
201 reads

An Introduction to the Xanny Framework

by Yasser Ameur El IdrissiDecember 22nd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Xanny is a simple, fast and low HTTP router and URL marcher for building Deno servers. It provides a robust set of features to develop web and mobile applications. Xanny finally reached version 1.0 in Dec 2020. The framework is developer friendly, very expressive, and helps the developer in their daily use, without sacrificing performance and security. The Xanny Framework is available on the open-source version of Deno and is available in the next version of the Deno version.

Coin Mentioned

Mention Thumbnail
featured image - An Introduction to the Xanny Framework
Yasser Ameur El Idrissi HackerNoon profile picture

Xanny finally reached version 1.0 in Dec 2020. According to its official repository, Xanny is a simple, fast and low HTTP router and URL marcher for building Deno servers.

You can assume Xanny as a layer built on the top of the Deno that helps manage a server and routes. It provides a robust set of features to develop web and mobile applications.

Let's see some of the core features of Xanny framework:

  • Developer friendly, very expressive, and helps 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.

Installing Xanny

Assuming you’ve already installed Deno, create a directory and

.ts
file to hold your code, and make that your working directory.

$ mkdir xanny-app
$ cd xanny-app
$ touch xanny_example.ts

So to use version 1.0.0 of xanny, you would want to import

https://deno.land/x/[email protected]/lib/mod.ts

Let's start registering a couple of URL paths and handlers:

Here we register two routes mapping URL path to handler. if an incoming request URL matches one of the paths, the corresponding handler is called passing.

We believe development must be an enjoyable and creative experience to be truly fulfilling (

HttpRequest
,
HttpResponse
) as parameters.

As you can see Xanny provides a very simple and expressive method of defining routes and behavior without complicated routing.

To see the results you need to start a web server on your development machine.

You can do this by running the following command in the

xanny-app
directory:

deno run --allow-net xanny_example.ts

To see your application in action, open a browser window and navigate to http://localhost:8080. You should see the Xanny

Hello Xanny.

We encourage you to contribute to Xanny! Please check out the guidelines about how to proceed.

Whether you’re helping us fix bugs, improve the docs, or spread the word, we’d love to have you as part of the Xanny community! 💪💜 See CONTRIBUTING.md for more information on what we’re looking for and how to get started.

👉 Github Repository