This commit is contained in:
2025-08-15 12:17:19 +02:00
parent 0fb46cb43f
commit 4bb071cbb5

View File

@@ -14,17 +14,9 @@ import {
import { generateToken, authenticate } from "./services/tokenService.js"; import { generateToken, authenticate } from "./services/tokenService.js";
env.config(); env.config();
const app = express(); const app = express();
const port = 8002; const port = 8502;
app.use( app.use(cors());
cors({
origin: ["https://backend.lose.the1s.de", "https://lose.the1s.de"],
credentials: true,
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allowedHeaders: ["Content-Type", "Authorization"],
})
);
app.options("*", cors());
// Increase body size limits to support large CSV JSON payloads // Increase body size limits to support large CSV JSON payloads
app.use(express.urlencoded({ extended: true, limit: "10mb" })); app.use(express.urlencoded({ extended: true, limit: "10mb" }));
app.set("view engine", "ejs"); app.set("view engine", "ejs");
@@ -43,8 +35,6 @@ app.post("/lose", async (req, res) => {
} }
}); });
// !!!!!!! AUTHORISATION HINZUFÜGEN - DENN GEHT NICHT !!!!!!!!
app.get("/table-data", authenticate, async (req, res) => { app.get("/table-data", authenticate, async (req, res) => {
const result = await getTableData(); const result = await getTableData();
if (result.success && result.data) { if (result.success && result.data) {