X Server
A Deno server module. Coming Soon.
Use
https://deno.land/x/xserver/mod.ts
Example
import {
Server,
Router,
Handler,
Normalize
} from 'https://deno.land/x/xserver/mod.ts';
const port = 8080;
const router = new Router();
const handler = new Handler();
const normalize = new Normalize();
router.get('/post', context => context.end(200, 'post'));
router.get('/*', context => context.end(200, 'get'));
handler.add(normalize);
handler.add(router);
Server(request => handler.handle(request), { port });
console.log(`listening: ${port}`);