node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org ยป


HTTP Pasta

A collection of req/res functions that I have found myself copy pastaing around.

I am trying to separate the pasta into useful strands.


opts.log is an optional log function to be used implace of gen-pasta's log. Returns object p w/ all other methods.


Takes a responce and returns a function that takes an error and optional error code.

p.notyet(req, res)



Create a function that responds 302 to url.

p.jsonCORS(req, res)

Add cors headers.

p.refuse(req, res, allowed)

405 method not allowed, what is?


Returns a function that dispatches a req/res to the correct function for that method.