Skip to content

Commit 2729d83

Browse files
committed
Update API port and URLs to use 3000
Changed default API port and related URLs from 3100 to 3000 in both client and server configurations for consistency. Updated trusted origins and proxy targets to reflect the new port.
1 parent d54568e commit 2729d83

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

packages/api/src/auth/auth.client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export const getAuth = async () => {
1414
});
1515
authInstance = betterAuth({
1616
database: pool,
17-
baseURL: process.env.BETTER_AUTH_URL || "http://localhost:3100/api/v6/auth",
18-
trustedOrigins: ["http://localhost:5173", "http://localhost:3000", "http://localhost:3100"],
17+
baseURL: process.env.BETTER_AUTH_URL || "http://localhost:3000/api/v6/auth",
18+
trustedOrigins: ["http://localhost:5173", "http://localhost:3000", "http://localhost:3000"],
1919
emailAndPassword: {
2020
enabled: true
2121
},

packages/api/src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ async function bootstrap() {
99
credentials: true
1010
});
1111

12-
// NestJS by default listens on 3000
13-
await app.listen(3000);
12+
// Listen on PORT or default to 3000 to match client proxy
13+
const port = process.env.PORT || 3000;
14+
await app.listen(port);
1415
console.log(`Application is running on: ${await app.getUrl()}`);
1516
}
1617
bootstrap();

packages/client/src/lib/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createAuthClient } from "better-auth/react"
22
import { organizationClient } from "better-auth/client/plugins"
33

44
export const authClient = createAuthClient({
5-
baseURL: typeof window !== "undefined" ? window.location.origin + "/api/v6/auth" : "http://localhost:3100/api/v6/auth",
5+
baseURL: typeof window !== "undefined" ? window.location.origin + "/api/v6/auth" : "http://localhost:3000/api/v6/auth",
66
plugins: [
77
organizationClient()
88
]

packages/client/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
server: {
1414
proxy: {
1515
'/api': {
16-
target: 'http://localhost:3100',
16+
target: 'http://localhost:3000',
1717
changeOrigin: true,
1818
}
1919
}

0 commit comments

Comments
 (0)