Update to remove CORS exclusions

This commit is contained in:
William Moore 2023-06-15 15:01:29 -05:00
parent b1936e89bc
commit d1549bf553

View File

@ -3,7 +3,6 @@ import express from 'express';
import 'dotenv/config';
import fetch from 'node-fetch';
import { subHours, subSeconds } from 'date-fns'
import cors from 'cors';
import {
createDB,
createTable,
@ -38,12 +37,10 @@ const dataPointsTable = createTable<DataPoint>(db, 'dataPoints')();
const app = express();
app.use(
'/',
json(),
'/',
json(),
);
app.use(cors());
app.get('/:name', async (req: any, res: any) => {
const startTime = subHours(new Date(), 24);
const result = await many(dataPointsTable, {