This commit is contained in:
@@ -18,6 +18,7 @@ const app = express();
|
||||
import fs from "fs/promises";
|
||||
import { getCurrentInterval } from "./scheduleRules.js";
|
||||
import bodyParser from "body-parser";
|
||||
import cors from "cors";
|
||||
|
||||
const VERSIONS = ["v1", "v2"];
|
||||
const PORT = process.env.PORT || 3000;
|
||||
@@ -26,6 +27,13 @@ globalThis.File = class File {};
|
||||
|
||||
app.use(bodyParser.json());
|
||||
|
||||
app.use(cors({
|
||||
origin: "*",
|
||||
methods: ["GET", "POST", "OPTIONS"],
|
||||
allowedHeaders: ["Content-Type"],
|
||||
}));
|
||||
app.options("*", cors());
|
||||
|
||||
app.get('/', async (req, res) => {
|
||||
const userAgent = req.headers['user-agent'] || '';
|
||||
const isBrowser = /Mozilla|Chrome|Firefox|Safari|Edg/.test(userAgent);
|
||||
|
||||
Reference in New Issue
Block a user