No description, website, or topics provided.
Perl 6
Switch branches/tags
Nothing to show
Latest commit 7a3be16 Jul 26, 2017 @tony-o readme, bleh
Permalink
Failed to load latest commit information.
lib/HTTP/Server/Router init Jul 26, 2017
t init Jul 26, 2017
.gitignore init Jul 26, 2017
META6.json init Jul 26, 2017
README.md readme, bleh Jul 26, 2017

README.md

A simply YAML router for HTTP::Server::Router

A simple YAML router for HTTP::Server::Router

Usage

use HTTP::Server::Router::YAML;
use HTTP::Server::Async;

my $s = HTTP::Server::Async.new;

serve $s;
route-yaml 'route1.yaml';

$s.listen(True);
---
paths:
  /test: # this is the path, you can use :placeholders too
    controller: Whatever #an attempt to require this module will be made
    sub:        test     #this is the method in the module that the requests
                         #   to path will passed along to

Methods

serve

This method expects an HTTP::Server as an argument and will bind itself to whatever server(s) is supplied.

route-yaml (Str $path-to-yaml-file)

This method will attempt to parse the yaml file and bind any paths possible

credits

tony-o