20 lines
567 B
JavaScript
20 lines
567 B
JavaScript
const router = require("express").Router()
|
|
|
|
// Models
|
|
const handleClimateUpdate = require("../models/handleClimateUpdate.js")
|
|
const handleClimateUpdateV2 = require("../models/handleClimateUpdateV2.js")
|
|
|
|
module.exports = dbConn => {
|
|
router.put("/api/v1/climate/update", async (req, res) => {
|
|
const update = await handleClimateUpdate(dbConn)
|
|
res.json(update)
|
|
});
|
|
|
|
router.put("/api/v1/climate/update/v2", async (req, res) => {
|
|
const update = await handleClimateUpdateV2(dbConn)
|
|
res.json(update)
|
|
});
|
|
|
|
return router;
|
|
};
|