Skip to content

Commit ee96ff9

Browse files
committed
feat: routes (#2365)
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
1 parent 564a402 commit ee96ff9

File tree

251 files changed

+12819
-890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+12819
-890
lines changed

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Do not use cat, hexdump, perl, or sed. Always edit files directly.
2+
- If attempting to use Cargo, use `nix-shell --command 'cargo ...'`

Cargo.lock

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 1 deletion
Large diffs are not rendered by default.

docker/dev-full/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ services:
131131
restart: unless-stopped
132132
command: /usr/bin/rivet-guard
133133
environment:
134+
- RUST_LOG=debug
134135
- RUST_BACKTRACE=1
135136
- RUST_LOG_ANSI_COLOR=1
136137
- RIVET_OTEL_ENABLED=1

examples/TODO.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/example-registry.jsonc

Lines changed: 0 additions & 37 deletions
This file was deleted.

examples/functions-js/http.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import type { ActorContext } from "@rivet-gg/actor-core";
2+
import { Hono } from "hono";
3+
4+
// Setup Hono app
5+
const app = new Hono();
6+
7+
app.get("/", (c) => {
8+
return c.text("ok");
9+
});
10+
11+
app.get("/health", (c) => {
12+
return c.text("ok");
13+
});
14+
15+
// Start server
16+
export default {
17+
async start(ctx: ActorContext) {
18+
// Find port
19+
const portEnv = Deno.env.get("PORT_HTTP");
20+
if (!portEnv) {
21+
throw new Error("missing PORT_HTTP");
22+
}
23+
const port = Number.parseInt(portEnv);
24+
25+
// Start server
26+
console.log(`Listening on port ${port}`);
27+
const server = Deno.serve({ port }, app.fetch);
28+
await server.finished;
29+
},
30+
};

examples/functions-js/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "example-functions",
3+
"version": "1.0.0",
4+
"private": true,
5+
"dependencies": {
6+
"@rivet-gg/actor": "^5.1.2",
7+
"hono": "^4.6.17"
8+
}
9+
}

examples/functions-js/rivet.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"functions": {
3+
"simple": {
4+
"script": "http.ts"
5+
}
6+
}
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "ESNext",
5+
"moduleResolution": "bundler",
6+
"types": ["node", "deno"],
7+
"allowSyntheticDefaultImports": true,
8+
"esModuleInterop": true,
9+
"noEmit": true,
10+
"isolatedModules": true
11+
},
12+
"include": ["**/*.ts"]
13+
}

0 commit comments

Comments
 (0)