generated from lucien/api-template
13 lines
No EOL
359 B
JavaScript
13 lines
No EOL
359 B
JavaScript
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; |