aboutsummaryrefslogtreecommitdiffstats
path: root/routes/rates.ts
blob: 67c111d79bdf13f5daf926ee4ee5443e02c3e78a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { g } from "$lib/db";
import { rate } from "$lib/rates";

export default {
  async fx(_, res) {
    const { fx } = await g("fx");
    res.send({ fx });
  },

  async last(_, res) {
    res.send(rate || (await g("rate")));
  },

  async index(_, res) {
    res.send(await g("rates"));
  },
};