mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 07:03:31 +00:00
Configure Foundry Rivet runner pool for /v1
This commit is contained in:
parent
a8bcfa36bb
commit
bc782879c2
1 changed files with 16 additions and 0 deletions
|
|
@ -8,9 +8,25 @@ import { project } from "./project/index.js";
|
||||||
import { sandboxInstance } from "./sandbox-instance/index.js";
|
import { sandboxInstance } from "./sandbox-instance/index.js";
|
||||||
import { workspace } from "./workspace/index.js";
|
import { workspace } from "./workspace/index.js";
|
||||||
|
|
||||||
|
function normalizePublicApiUrl(raw: string | undefined): string | undefined {
|
||||||
|
const value = raw?.trim();
|
||||||
|
if (!value) return undefined;
|
||||||
|
return value.replace(/\/$/, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
const publicApiUrl = normalizePublicApiUrl(process.env.BETTER_AUTH_URL);
|
||||||
|
const shouldConfigureRunnerPool = Boolean(publicApiUrl && (process.env.RIVET_ENDPOINT || process.env.RIVET_ENGINE));
|
||||||
|
|
||||||
export const registry = setup({
|
export const registry = setup({
|
||||||
serverless: {
|
serverless: {
|
||||||
basePath: "/v1/rivet",
|
basePath: "/v1/rivet",
|
||||||
|
...(shouldConfigureRunnerPool
|
||||||
|
? {
|
||||||
|
configureRunnerPool: {
|
||||||
|
url: `${publicApiUrl}/v1/rivet/start`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
},
|
},
|
||||||
use: {
|
use: {
|
||||||
workspace,
|
workspace,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue