@server/next 0.17.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@server/next",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "An experimental reimplementation of server.js focused on the DX",
5
5
  "homepage": "https://node-server.com/",
6
6
  "repository": "https://github.com/franciscop/server-next.git",
package/readme.md CHANGED
@@ -49,7 +49,7 @@ Major changes:
49
49
 
50
50
  - Router has all verbs, as well as URL pattern matches
51
51
  - Full URL parsing, including `query` and `params` in ctx.url.
52
- - Body and Files parsing is working (TODO: try with binary files and add tests)
52
+ - Body and Files parsing is working (need testing)
53
53
  - The middleware can return:
54
54
  - A number and it'll be set as the status code
55
55
  - A string and it'll be sent as plain text or html (if it starts with "<")
@@ -70,7 +70,7 @@ import Redis from 'redis';
70
70
  const bucket = Bucket('my-bucket', { id, key });
71
71
  const cache = Redis('my-redis', ...);
72
72
 
73
- const app = server({ public: bucket, cache });
73
+ const app = server({ public: bucket, uploads: bucket, cache });
74
74
 
75
75
  app([
76
76
  post('/uploads', ctx => {
package/src/index.js CHANGED
@@ -191,7 +191,7 @@ export default function (options = {}, plugins) {
191
191
  if (cb.handle) {
192
192
  out = await cb.handle(err);
193
193
  }
194
- } else {
194
+ } else if (typeof cb === "function") {
195
195
  out = await cb(ctx);
196
196
  }
197
197
  if (out) {