Skip to content

gulujs/route-hunter

Repository files navigation

@gulujs/route-hunter

Installation

npm install @gulujs/route-hunter

Usage

import * as http from 'http';
import { RouteHunger } from '@gulujs/route-hunter';

const router = new RouteHunter();
router.on('GET', '/', (req, res, params) => {
  res.end('{"message": "Hello world!"}');
});

const server = http.createServer((req, res) => {
  router.lookup(req, res);
});

server.listen(3000, err => {
  if (err) {
    throw err;
  }
  console.log('Server listening on: http://localhost:3000');
});

Inspired by

License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published