more work!

This commit is contained in:
newtbot
2023-12-31 02:30:49 +08:00
parent 233ebafdcb
commit 234906ada5
18 changed files with 394 additions and 238 deletions

View File

@@ -5,23 +5,6 @@ const { getallData } = require("../functions/APIDatabase.js");
const express = require('express');
const router = express.Router();
/*
async function getallData() {
try {
sequelize.sync();
const allData = await IoTModel.findAll({
attributes: ['id', 'psiData', 'humidityData', 'o3Data', 'no2Data', 'so2Data', 'coData', 'temperatureData', 'windspeedData', 'currentTime', 'regionData' , 'createdAt' , 'updatedAt'],
});
return allData;
}
catch(error) {
console.error(error);
return null;
}
}
*/
router.get('/', async (req, res) => {
try {
const data = await getallData();