generated from lucien/api-template
add: changed homepage to display most active channels
This commit is contained in:
parent
411aa149ac
commit
dfb6639ecf
10 changed files with 179 additions and 14 deletions
13
back/api/activechannels.js
Normal file
13
back/api/activechannels.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const express = require('express');
|
||||
const { getConnection, getActiveChannels } = require('../libs/mysql');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', async (req, res) => {
|
||||
const connection = await getConnection();
|
||||
const channels = await getActiveChannels(connection);
|
||||
connection.end();
|
||||
res.send(channels);
|
||||
});
|
||||
|
||||
module.exports = router;
|
Loading…
Add table
Add a link
Reference in a new issue