dataRouter.js 583 Bytes
Newer Older
1
2
import express from "express";
import routes from "../routes";
3
4
import {
  getDataInput,
5
  getLocCode,
6
  getOutWeatherData,
7
8
  getUserWeatherData,
} from "../controllers/dataController";
9
import { onlyPrivate } from "../middlewares";
10
11
12

const dataRouter = express.Router();

13
// Weather Data Collection
14
dataRouter.get(routes.dataInput, getDataInput);
15
16

// Send Weather Data
17
dataRouter.get(routes.dataUser, onlyPrivate, getUserWeatherData);
18
19
20
dataRouter.get(routes.dataOutside, getOutWeatherData);

// Send Location Info
21
dataRouter.get(routes.locCode, getLocCode);
22
23

export default dataRouter;