Add support for MySQL.

This commit is contained in:
Mike Cao 2020-08-11 20:05:40 -07:00
parent e309376150
commit a248f35db2
9 changed files with 302 additions and 102 deletions

View file

@ -7,11 +7,7 @@ export default async (req, res) => {
const { id, start_at, end_at } = req.query;
const metrics = await getMetrics(
+id,
new Date(+start_at).toISOString(),
new Date(+end_at).toISOString(),
);
const metrics = await getMetrics(+id, new Date(+start_at), new Date(+end_at));
const stats = Object.keys(metrics[0]).reduce((obj, key) => {
obj[key] = +metrics[0][key];