Thanks to visit codestin.com
Credit goes to github.com

Skip to content

heapwolf/route

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

A very simple request router for C++

EXAMPLE

This example uses the libuv-http server.

#include "http.h"
#include "route.h"

int main() {

  Router router;

  Server hs([](auto &req, auto &res) {

    auto match = router.set(req.url);

    if (match.test("/books/:id") {

      res.setStatus(200);
      res.setHeader("Content-Type", "text/plain");
      res.setHeader("Connection", "keep-alive");

      res << "You ordered #" << match.get("id") << res.end();
    }

  });

  hs.listen("0.0.0.0", 8000);
}

INSTALL

clib install hij1nx/route

TEST

make

About

A simple http router in c++ that can be used with nodeuv-http

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •