Refactor: Oddělení konektoru na parser menu
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import express from "express";
|
||||
import { Server } from "socket.io";
|
||||
import bodyParser from "body-parser";
|
||||
import { fetchFood, fetchPizzy } from "./chefie";
|
||||
import { fetchPizzy } from "./chefie";
|
||||
import cors from 'cors';
|
||||
import { getData, updateChoice } from "./service";
|
||||
import dotenv from 'dotenv';
|
||||
import path from 'path';
|
||||
import { fetchMenus } from "./restaurants";
|
||||
|
||||
const ENVIRONMENT = process.env.NODE_ENV || 'production'
|
||||
dotenv.config({ path: path.resolve(__dirname, `../.env.${ENVIRONMENT}`) });
|
||||
@@ -33,7 +34,7 @@ app.get("/api/data", (req, res) => {
|
||||
|
||||
/** Vrátí obědové menu pro dostupné podniky. */
|
||||
app.get("/api/food", (req, res) => {
|
||||
fetchFood().then(food => {
|
||||
fetchMenus().then(food => {
|
||||
res.status(200).json(food);
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user