Skip to content

Commit 335088d

Browse files
committed
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. -->
1 parent fde245d commit 335088d

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

site/src/content/docs/functions.mdx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,10 @@ npm init -y
2424
npm install hono@4 @hono/node-server@1
2525
```
2626

27-
Add the following files:
2827

29-
<CodeGroup>
28+
Add the following files to your project:
3029

31-
```json {{ "title": "rivet.json" }}
32-
{
33-
"functions": {
34-
"hello-world": {
35-
"dockerfile": "Dockerfile"
36-
}
37-
}
38-
}
39-
```
30+
<CodeGroup>
4031

4132
```javascript {{ "title": "index.js" }}
4233
import { Hono } from "hono";
@@ -56,6 +47,16 @@ serve({
5647
});
5748
```
5849

50+
```json {{ "title": "rivet.json" }}
51+
{
52+
"functions": {
53+
"hello-world": {
54+
"dockerfile": "Dockerfile"
55+
}
56+
}
57+
}
58+
```
59+
5960
```dockerfile {{ "title": "Dockerfile" }}
6061
FROM node:22-alpine
6162

@@ -75,7 +76,11 @@ CMD ["node", "index.js"]
7576

7677
</CodeGroup>
7778

78-
See [Containers documentation](/docs/containers) for more information on writing code for the Rivet platform.
79+
<Info title="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.
7984

8085
### 2. Deploy your function
8186

@@ -100,7 +105,7 @@ Visit your function at the configured URL. You can monitor the logs in the _Logs
100105
| `strip_prefix` | When true, removes the configured path prefix from the request URL before forwarding to your function |
101106
| `resources.cpu` | CPU allocation for the function (defaults to 1) |
102107
| `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) |
104109

105110
#### Example: route_subpaths
106111

0 commit comments

Comments
 (0)