Created
December 12, 2017 05:57
-
-
Save nomoney4me/96aee6f21018d926ebcaec7767d6fa0e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var io = require('socket.io').listen(server); | |
// ----------------- https server --------- | |
app.use(express.static(__dirname+'/public')); | |
app.use(bodyParser.urlencoded({ extended: false })) | |
// ---------------------------custom function ----------------------- | |
/* | |
----------------------------------------- | |
displayList() | |
----------------------------------------- | |
*/ | |
function displayList(gradelevel) { | |
var now = moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'); | |
var query = process.env.query; | |
var studentList = knex.raw(query).then((result) => { | |
return result.rows | |
}) | |
studentList.then((list) => {}, []) | |
var newList = list; | |
// do alot of things and then return newList | |
io.to(gradelevel).emit('students result list', newList) | |
}) | |
} //end displayList() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment