@server/next 0.20.19 → 0.20.20

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +2 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@server/next",
3
- "version": "0.20.19",
3
+ "version": "0.20.20",
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/src/index.js CHANGED
@@ -116,8 +116,7 @@ const extendWithDefaults = (ctx) => {
116
116
  export default function server(options = {}) {
117
117
  // Make it so that the exported one is a prototype of function()
118
118
  if (!(this instanceof server)) {
119
- const inst = new server(options);
120
- return inst.self();
119
+ return new server(options).self();
121
120
  }
122
121
 
123
122
  // Skip "forbidden methods" https://fetch.spec.whatwg.org/#concept-method
@@ -252,7 +251,7 @@ server.prototype.router = function (basePath, router) {
252
251
  this.handle(method, basePath + path.replace(/^\//, ""), ...callbacks);
253
252
  });
254
253
  }
255
- return this;
254
+ return this.self();
256
255
  };
257
256
 
258
257
  server.prototype.test = function () {