Skip to content

Commit e2b121f

Browse files
committed
Add a named function for serverless middleware to make it more obvious what’s happening in the dev server.
(cherry picked from commit 4fb89d3)
1 parent 6b3db05 commit e2b121f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Plugins/ServerlessBundlerPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class BundlerHelper {
230230
);
231231
deleteRequireCache(TemplatePath.absolutePath(serverlessFilepath));
232232

233-
return async (req, res, next) => {
233+
return async function EleventyServerlessMiddleware(req, res, next) {
234234
let serverlessFunction = require(serverlessFilepath);
235235
let url = new URL(req.url, "http://localhost/"); // any domain will do here, we just want the searchParams
236236
let queryParams = Object.fromEntries(url.searchParams);
@@ -257,7 +257,7 @@ class BundlerHelper {
257257
this.eleventyConfig.logger.forceLog(
258258
`Serverless (${this.name}): ${req.url} (${Date.now() - start}ms)`
259259
);
260-
};
260+
}.bind(this);
261261
}
262262

263263
async ensureDir() {

0 commit comments

Comments
 (0)