You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADE.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,60 @@
1
+
## From 4.x to 5.x
2
+
3
+
### Minimum Node.js Version
4
+
5
+
v5.x officially supports Node.js 24 and later, though it will likely work for earlier versions.
6
+
7
+
### Handler Changes
8
+
9
+
The handler no longer accepts a `callback` parameter. It must be used with async/Promise patterns only.
10
+
11
+
```javascript
12
+
// 4.x (still works but callback-based patterns no longer supported)
13
+
exports.handler=serverlessExpress({ app })
14
+
15
+
// 5.x (same, but MUST be async/Promise-based)
16
+
exportdefaultserverlessExpress({ app })
17
+
```
18
+
19
+
### Removed Options
20
+
21
+
The following configuration options have been removed:
22
+
23
+
-`resolutionMode` - Only Promise-based resolution is supported now
24
+
-`binaryMimeTypes` - Use `binarySettings` instead
25
+
26
+
```javascript
27
+
// 4.x (deprecated)
28
+
serverlessExpress({
29
+
app,
30
+
resolutionMode:'CALLBACK', // ❌ Removed
31
+
binaryMimeTypes: ['image/*'] // ❌ Removed
32
+
})
33
+
34
+
// 5.x
35
+
serverlessExpress({
36
+
app,
37
+
binarySettings: {
38
+
contentTypes: ['image/*']
39
+
}
40
+
})
41
+
```
42
+
43
+
### Removed Methods
44
+
45
+
The following deprecated methods have been removed:
46
+
47
+
-`serverlessExpress.createServer()` - Use `serverlessExpress({ app })` instead
48
+
-`serverlessExpress.proxy()` - Use `serverlessExpress({ app })` instead
49
+
-`handler.handler()` - Use `handler()` directly
50
+
-`handler.proxy()` - Use `handler()` directly
51
+
52
+
### Proxy Path Fix
53
+
54
+
v5.x includes a fix for nested routes and custom domains. If you use API Gateway with a custom domain and base path mapping, routes should now work correctly.
Copy file name to clipboardExpand all lines: package.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@codegenie/serverless-express",
3
-
"version": "4.17.1",
3
+
"version": "5.0.0",
4
4
"description": "This library enables you to utilize AWS Lambda and Amazon API Gateway to respond to web and API requests using your existing Node.js application framework.",
0 commit comments