@gulujs/route-hunter
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@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

Package Sidebar

Install

npm i @gulujs/route-hunter

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

8.22 kB

Total Files

5

Last publish

Collaborators

  • jkeylu