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
docs: clarify default port in Rivet Functions (#2608)
<!-- Please make sure there is an issue that this PR is correlated to. -->
## Changes
<!-- If there are frontend changes, please include screenshots. -->
Copy file name to clipboardExpand all lines: site/src/content/docs/functions.mdx
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,19 +24,10 @@ npm init -y
24
24
npm install hono@4 @hono/node-server@1
25
25
```
26
26
27
-
Add the following files:
28
27
29
-
<CodeGroup>
28
+
Add the following files to your project:
30
29
31
-
```json {{ "title": "rivet.json" }}
32
-
{
33
-
"functions": {
34
-
"hello-world": {
35
-
"dockerfile": "Dockerfile"
36
-
}
37
-
}
38
-
}
39
-
```
30
+
<CodeGroup>
40
31
41
32
```javascript {{ "title": "index.js" }}
42
33
import { Hono } from"hono";
@@ -56,6 +47,16 @@ serve({
56
47
});
57
48
```
58
49
50
+
```json {{ "title": "rivet.json" }}
51
+
{
52
+
"functions": {
53
+
"hello-world": {
54
+
"dockerfile": "Dockerfile"
55
+
}
56
+
}
57
+
}
58
+
```
59
+
59
60
```dockerfile {{ "title": "Dockerfile" }}
60
61
FROM node:22-alpine
61
62
@@ -75,7 +76,11 @@ CMD ["node", "index.js"]
75
76
76
77
</CodeGroup>
77
78
78
-
See [Containers documentation](/docs/containers) for more information on writing code for the Rivet platform.
79
+
<Infotitle="Configuring port">
80
+
By default, Rivet Functions will listen on port 8080. This can be configured using the `networking.internal_port` option in your configuration (see [Configuration Options](#configuration-options) below).
81
+
</Info>
82
+
83
+
See [Rivet Containers documentation](/docs/containers) for more information on writing code for the Rivet platform.
79
84
80
85
### 2. Deploy your function
81
86
@@ -100,7 +105,7 @@ Visit your function at the configured URL. You can monitor the logs in the _Logs
100
105
|`strip_prefix`| When true, removes the configured path prefix from the request URL before forwarding to your function |
101
106
|`resources.cpu`| CPU allocation for the function (defaults to 1) |
102
107
|`resources.memory`| Memory allocation in MB (defaults to 1024) |
103
-
|`networking.internal_port`| The port your function listens on within the container |
108
+
|`networking.internal_port`| The port your function listens on within the container (defaults to 8080) |
0 commit comments