This repository was archived by the owner on Oct 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ import { getLogger } from "rivetkit/log" ;
2+
3+ export function logger ( ) {
4+ return getLogger ( "driver-next-js" ) ;
5+ }
Original file line number Diff line number Diff line change 11import type { Registry , RunConfigInput } from "rivetkit" ;
2+ import { logger } from "./log" ;
23
34export const toNextHandler = (
45 registry : Registry < any > ,
@@ -12,6 +13,10 @@ export const toNextHandler = (
1213
1314 // Auto-configure serverless runner if not in prod
1415 if ( process . env . NODE_ENV !== "production" ) {
16+ logger ( ) . debug (
17+ "detected development environment, auto-starting engine and auto-configuring serverless" ,
18+ ) ;
19+
1520 const publicUrl =
1621 process . env . NEXT_PUBLIC_SITE_URL ??
1722 process . env . NEXT_PUBLIC_VERCEL_URL ??
@@ -21,6 +26,10 @@ export const toNextHandler = (
2126 inputConfig . autoConfigureServerless = {
2227 url : `${ publicUrl } /api/rivet/start` ,
2328 } ;
29+ } else {
30+ logger ( ) . debug (
31+ "detected production environment, will not auto-start engine and auto-configure serverless" ,
32+ ) ;
2433 }
2534
2635 // Next logs this on every request
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export function chooseDefaultDriver(runConfig: RunnerConfig): DriverConfig {
1818 return runConfig . driver ;
1919 }
2020
21- if ( runConfig . endpoint || runConfig . token ) {
21+ if (
22+ runConfig . endpoint ||
23+ runConfig . token ||
24+ runConfig . runnerKind === "serverless"
25+ ) {
2226 loggerWithoutContext ( ) . debug ( {
2327 msg : "using rivet engine driver" ,
2428 endpoint : runConfig . endpoint ,
You can’t perform that action at this time.
0 commit comments