const App = () => {
const chatMsgStore = useChatStore()
const AppFunctions = {chatMsgStore}
useEffect(() => {
socket.on(activechat.chatid, (bdmsg) => {
chatMsgStore.addChatMsg(bdmsg)
})
return () => {
socket.off(activechat.chatid)
}
}, [activechat, chatMsgStore.chatmsg])
return (
<>
<AppContext.Provider value={AppFunctions}>
.....................................................
</AppContext.Provider>
</>
)
}
export default App;
app.use(cors({
origin: "http://localhost:3000",
credentials: true,
}))
Set-Cookie: refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbiI6InRlc3QiLCJpZCI6IjYxOTEyNzQ5YjBkODZmOTRlOWM0YWI0ZSIsImlhdCI6MTYzODEzMzk2OSwiZXhwIjoxNjQwNzI1OTY5fQ.SrCU9BRE1ZNc0GlWuEANLvRH6hkK5R16DN9jh_fCXWQ; Max-Age=2592000; Path=/; Expires=Tue, 28 Dec 2021 21:12:49 GMT