frontend added and socket io
This commit is contained in:
6
frontend/src/lib/auth-client.ts
Normal file
6
frontend/src/lib/auth-client.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { createAuthClient } from "better-auth/react"
|
||||
export const authClient = createAuthClient({
|
||||
baseURL: "http://localhost:3000/lst/api/auth" // The base URL of your auth server
|
||||
})
|
||||
|
||||
export const { useSession, signUp, signIn, signOut } = authClient
|
||||
12
frontend/src/lib/socket.io.ts
Normal file
12
frontend/src/lib/socket.io.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { io } from "socket.io-client";
|
||||
|
||||
// Connect to your Socket.io server
|
||||
const socket = io(`${window.location.host}`, {
|
||||
path: "/lst/api/socket.io",
|
||||
// autoConnect: false, // connect manually
|
||||
// reconnection: true,
|
||||
// reconnectionAttempts: 5,
|
||||
// reconnectionDelay: 1000,
|
||||
});
|
||||
|
||||
export default socket;
|
||||
6
frontend/src/lib/utils.ts
Normal file
6
frontend/src/lib/utils.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { clsx, type ClassValue } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
Reference in New Issue
Block a user