0.0.5 • Published 11 months ago

http-dispatch v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
11 months ago

http-dispatch

Pass this function the result of a http routing lookup (of the format { value, args, query }) and have the value be a function, then it will call that function in a manner of fn(...args, query, req).

Examples

http.createServer(function( request, response ){
	const match = route(request);
	// -> { value: { fn }, args, query }

	if (!match)
		return;	// probably send 404

	const result = dispatch(match, request);

	// probably send the result as a response
})
	.listen(8000);
0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago