const express = require('express'); const router = express.Router(); const { getConnection, getShares } = require("../libs/mysql.js") router.get('/', async (req, res) => { const connection = await getConnection() const shares = await getShares(connection) connection.end() if (!shares[0]) { return res.status(500).send({message: "There are no shares in the databse."}) } return res.status(200).send(shares) }); module.exports = router;