This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express" | |
import next from "next" | |
import bodyParser from "body-parser" | |
import cookieParser from "cookie-parser" | |
import dotenv from "dotenv" | |
import jwt from "jsonwebtoken" | |
import lusca from "lusca" | |
import moment from "moment" | |
import helmet from "helmet" | |
import Auth from "./tools/Auth" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
// socket.io | |
let socket = io.connect(window.location.href,{'forceNew':true }); | |
// notification | |
socket.on('notification', function(data){ | |
notification(data) | |
}); | |
// end socket io | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global.io.on('connection', (socket) => { | |
socket.setMaxListeners(20); | |
console.log('index connected') | |
socket.emit('notification', { | |
unread: 2, | |
list: [{ | |
requestor: { | |
name: 'hello', | |
id: 'word', | |
avatar:'https://semantic-ui.com/images/avatar2/small/rachel.png' |
NewerOlder