Skip to content

A simple, lightweight and powerful middleware for Deno.

License

Notifications You must be signed in to change notification settings

ryaangu/Snorlax.ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snorlax.ts

A simple, lightweight and powerful middleware for Deno.

The principles of this library is to:

  • be simple and easy to use;
  • be fast;
  • be straight to the point;

Example

import { Manager, Router } from Snorlax;

/*
    Setup the website.
*/

const manager : Manager = new Manager();
const router  : Router  = new Router ();

// Tell the manager to use the main router.
manager.use(router);

// https://localhost:8080/
router.get('/', async (context: Context) =>
{
    return context.respond("Hello, World!"); // Send a plain-text 'Hello, World!' with
                                             // status code 200 (OK) to the client.
});

// We've setup everything we needed, start listening to port 8080!
manager.listen({ port: 8080 });

About

A simple, lightweight and powerful middleware for Deno.

Resources

License

Stars

Watchers

Forks