Skip to content

Commit

Permalink
feat: added support for nodejs22 (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop authored Jan 17, 2025
1 parent 9dbe321 commit 5096189
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dockercompose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func functions( //nolint:funlen
}

return &Service{
Image: fmt.Sprintf("nhost/functions:%d-1.3.0", *cfg.GetFunctions().GetNode().Version),
Image: fmt.Sprintf("nhost/functions:%d-1.4.0", *cfg.GetFunctions().GetNode().Version),
DependsOn: nil,
EntryPoint: nil,
Command: nil,
Expand Down
5 changes: 5 additions & 0 deletions examples/myproject/functions/crash.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Request, Response } from 'express'

export default (_: Request, res: Response) => {
throw new Error('This is an unhandled error')
}
13 changes: 13 additions & 0 deletions examples/myproject/functions/error.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Request, Response } from 'express'

export default (_: Request, res: Response) => {
try {
throw new Error('This is an error')
} catch (error) {
console.log(error)
res.status(500).json({
error: error.message,
})
}
}

2 changes: 1 addition & 1 deletion examples/myproject/nhost/nhost.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ liveQueriesMultiplexedRefetchInterval = 3000

[functions]
[functions.node]
version = 20
version = 22

[auth]
version = '0.35.0'
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-getter v1.7.6
github.com/nhost/be v0.0.0-20250108140619-2d5cbe3d8d53
github.com/nhost/be v0.0.0-20250116151339-605671e870a1
github.com/pelletier/go-toml/v2 v2.2.3
github.com/rs/cors/wrapper/gin v0.0.0-20240830163046-1084d89a1692
github.com/sirupsen/logrus v1.9.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,8 @@ github.com/nhost/be v0.0.0-20250108133629-afef8c60957d h1:Qpm1om9RfHMFILg9LTZchP
github.com/nhost/be v0.0.0-20250108133629-afef8c60957d/go.mod h1:6lkCTKviZ+ZQDaYed7QFz4MoFb5sg10tlaux2AHeBEQ=
github.com/nhost/be v0.0.0-20250108140619-2d5cbe3d8d53 h1:a/HtPyxfMQCOUtCuFPfBCDiwXQe0qXHa2TN/zZ8QuSg=
github.com/nhost/be v0.0.0-20250108140619-2d5cbe3d8d53/go.mod h1:6lkCTKviZ+ZQDaYed7QFz4MoFb5sg10tlaux2AHeBEQ=
github.com/nhost/be v0.0.0-20250116151339-605671e870a1 h1:Ot50lURnX/giULeCXO2Q3dl+F144l4anQ9smEEtIFtI=
github.com/nhost/be v0.0.0-20250116151339-605671e870a1/go.mod h1:SgL7alnP/yxHF4Un46J+jowx+bi5e4kajmo1EI3C9QA=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ github.com/muesli/termenv
# github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
## explicit
github.com/munnerz/goautoneg
# github.com/nhost/be v0.0.0-20250108140619-2d5cbe3d8d53
# github.com/nhost/be v0.0.0-20250116151339-605671e870a1
## explicit; go 1.23.1
github.com/nhost/be/lib/graphql
github.com/nhost/be/lib/graphql/context
Expand Down

0 comments on commit 5096189

Please sign in to comment.