generated from lucien/api-template
add: improved the frontend and the backend by adding websockets
This commit is contained in:
parent
ecf7b61aca
commit
fbf7821320
18 changed files with 255 additions and 65 deletions
13
back/api/newchannels.js
Normal file
13
back/api/newchannels.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
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;
|
Loading…
Add table
Add a link
Reference in a new issue