small frontend rewrite
This commit is contained in:
13
plugins/socket.client.ts
Normal file
13
plugins/socket.client.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import io from 'socket.io-client';
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
const socket = io('http://localhost:3000', {
|
||||
auth: (cb) => cb({ token: useCookie('sessionToken').value })
|
||||
});
|
||||
|
||||
return {
|
||||
provide: {
|
||||
io: socket
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user