const express = require('express');
const { getConnection, getNewChannels } = require('../libs/mysql');

const router = express.Router();

router.get('/', async (req, res) => {
    const connection = await getConnection();
    const channels = await getNewChannels(connection);
    connection.end();
    res.send(channels);
});

module.exports = router;