skewten-incubator / pcb

Middleware-based API framework - It's Koa, but for APIs.
0 stars 0 forks source link

ctx.response -> ctx.status, ctx.body, ctx.message #8

Open SEAPUNK opened 8 years ago

SEAPUNK commented 8 years ago

Ref: https://github.com/koajs/koa/blob/v2.x/lib/response.js#L68-L179

SEAPUNK commented 8 years ago

Hell, why not even go the full mile, and do ctx.request, ctx.response?

SEAPUNK commented 8 years ago

I mean, it makes sense. The original goal was to have a smooth mapping of router -> raw function, but with all these changes and compatibility additions, this might as well be router -> pcb-function proxy -> raw function.

SEAPUNK commented 8 years ago

Practically how I'd do it if I used the Koa webserver instead.