Marek Czernek
2020-03-11 9f398580008ca3c7434d52630059c7db6cc4b30b
Remove mock calls
1 files modified
29 ■■■■■ changed files
mczernek-exchange-application/history/index.js 29 ●●●●● patch | view | raw | blame | history
mczernek-exchange-application/history/index.js
@@ -42,37 +42,8 @@
    res.json(dataWithDate).status(200);
}
/* MOCK for other microservice */
const getData = (req, res) => {
    const currencies = ["EUR", "USD"]
    res.setHeader('Content-Type', 'application/json');
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.json(currencies).status(200);
};
/* MOCK for other microservice
 */
const getCurrencyData = (req, resp) => {
    const currency = req.params.currency;
    var res = {value: ""}
    if(currency === "EUR") {
        res.value = 1.11
        res.srcSign = "€"
        res.targetSign = "$"
    } else {
        res.value = 0.9
        res.srcSign = "$"
        res.targetSign = "€"
    }
    resp.json(res).status(200);
}
app.post('/', postData);
app.get('/', getData);
app.get('/:currency', getCurrencyData)
app.listen(_const.PORT, () => {
    console.log(