MikeBild / graphql-pouch

GraphQL runtime using PouchDB
MIT License
204 stars 13 forks source link

Combining output delivery of functions and statics #15

Closed MikeBild closed 8 years ago

MikeBild commented 8 years ago

In some cases it would be useful to be able to give back server side generated content. Currently custom JS functions only supports application/json via ctx.success({}) and statics only supports static content delivered by path extension match. Following changes would be possible:

  1. Distinguish ctx.success output type (String, Object, Array, etc.) https://github.com/MikeBild/graphql-pouch/blob/master/lib/functions/index.js#L49
  2. Generalize default route for functions and statics to all('/*') and dispatch by path extensions