mirror of
https://github.com/Spengreb/sync.git
synced 2026-05-17 04:52:06 +00:00
19 lines
539 B
JavaScript
19 lines
539 B
JavaScript
import { sendJade } from '../jade';
|
|
|
|
export default function initialize(app, channelIndex) {
|
|
app.get('/', (req, res) => {
|
|
channelIndex.listPublicChannels().then((channels) => {
|
|
channels.sort((a, b) => {
|
|
if (a.usercount === b.usercount) {
|
|
return a.uniqueName > b.uniqueName ? -1 : 1;
|
|
}
|
|
|
|
return b.usercount - a.usercount;
|
|
});
|
|
|
|
sendJade(res, 'index', {
|
|
channels: channels
|
|
});
|
|
});
|
|
});
|
|
}
|