diff --git a/index.js b/index.js index b6113e7..ca7854a 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,12 @@ import path from "path"; import dotenv from "dotenv"; // Import files -import ncov from './controller/ncov.js'; +import { + fetchChinaData, + fetchAbroadData, + ChinaData, + WorldData, +} from "./controller/ncov.js"; // Initialize dotenv dotenv.config(); @@ -34,7 +39,7 @@ app.use(bodyParser.json({ limit: "30mb", extended: true })); app.use(bodyParser.urlencoded({ limit: "30mb", extended: true })); // Use ncov -ncov.use('fetchChinaData'); +fetchChinaData, fetchAbroadData, ChinaData, WorldData; // Connecting to MongoDB mongoose @@ -46,4 +51,4 @@ mongoose .catch((error) => console.log(error)); // // Allow us to change the port easily by setting an environment variable -const PORT = process.env.PORT || 8000; \ No newline at end of file +const PORT = process.env.PORT || 8000;