@vercel/express 0.0.19 → 0.0.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/dist/index.js +6 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -681,7 +681,9 @@ var invokeFunction = async (args, options) => {
681
681
  });
682
682
  };
683
683
  var expressShimSource = (args) => {
684
- const pathToExpress = require_3.resolve("express");
684
+ const pathToExpress = require_3.resolve("express", {
685
+ paths: [args.outputDir]
686
+ });
685
687
  const introspectionPath = getIntrospectionPath(args);
686
688
  return `
687
689
  const fs = require('fs');
@@ -721,10 +723,11 @@ const extractRoutes = () => {
721
723
  routesExtracted = true;
722
724
 
723
725
  const methods = ["all", "get", "post", "put", "delete", "patch", "options", "head"]
724
- if (!app || !app._router) {
726
+ if (!app) {
725
727
  return;
726
728
  }
727
- for (const route of app._router.stack) {
729
+ const router = app._router || app.router
730
+ for (const route of router.stack) {
728
731
  if(route.route) {
729
732
  const m = [];
730
733
  for (const method of methods) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/express",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "homepage": "https://vercel.com/docs",