File tree Expand file tree Collapse file tree 5 files changed +23
-7
lines changed
Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 1+ STANDALONE = " true"
Original file line number Diff line number Diff line change @@ -41,4 +41,5 @@ yarn-error.log*
4141** /* .log
4242package-lock.json
4343** /* .bun
44- * .exe
44+ * .exe
45+ .env
Original file line number Diff line number Diff line change 11import { describe , expect , it } from "bun:test" ;
2- import { app } from "../.." ;
2+ import app from "../.." ;
33
44describe ( "/hc" , ( ) => {
55 it ( "returns Server is healthy" , async ( ) => {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
33import { Elysia } from "elysia" ;
44import { appRouter } from "./trpc/routers" ;
55
6- export const app = new Elysia ( )
6+ const app = new Elysia ( )
77 . use ( cors ( ) )
88 . get ( "/hc" , ( ) => {
99 return {
@@ -19,11 +19,16 @@ export const app = new Elysia()
1919 return { } ;
2020 } ,
2121 } ) ;
22- } )
23- . listen ( process . env . PORT ?? 1337 ) ;
22+ } ) ;
23+
24+ if ( process . env . STANDALONE === "true" ) {
25+ app . listen ( process . env . PORT ?? 1337 ) ;
2426
25- if ( process . env . NODE_ENV === "test" ) {
26- console . log ( `Backend is running at ${ app . server ?. hostname } :${ app . server ?. port } ` ) ;
27+ if ( process . env . NODE_ENV !== "test" ) {
28+ console . log ( `Backend is running at ${ app . server ?. hostname } :${ app . server ?. port } ` ) ;
29+ }
2730}
2831
32+ export default app ;
33+
2934export type AppRouter = typeof appRouter ;
Original file line number Diff line number Diff line change 1+ {
2+ "$schema" : " https://openapi.vercel.sh/vercel.json" ,
3+ "rewrites" : [
4+ {
5+ "source" : " /(.*)" ,
6+ "destination" : " /src"
7+ }
8+ ]
9+ }
You can’t perform that action at this time.
0 commit comments