mirror of
https://github.com/detleph/server.git
synced 2026-09-07 16:06:18 +02:00
Add routes for admin authentication endpoints
+ Add router to the app
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
import express from "express";
|
||||||
|
import { authenticateUser } from "../Controllers/admin_auth.controller";
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
router.post("/", authenticateUser);
|
||||||
|
|
||||||
|
export default router;
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import prisma from "./lib/prisma";
|
import prisma from "./lib/prisma";
|
||||||
import eventRouter from "./Routes/event.routes";
|
import eventRouter from "./Routes/event.routes";
|
||||||
|
import adminAuthRouter from "./Routes/admin_auth.routes";
|
||||||
|
|
||||||
require("dotenv").config(); // Load dotenv config
|
require("dotenv").config(); // Load dotenv config
|
||||||
|
|
||||||
@@ -13,6 +14,9 @@ async function main() {
|
|||||||
app.use(express.urlencoded({ extended: true }));
|
app.use(express.urlencoded({ extended: true }));
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
|
// Admin authentication endpoints
|
||||||
|
app.use("/api/authentication", adminAuthRouter);
|
||||||
|
|
||||||
// All API endpoints are behind /api/...
|
// All API endpoints are behind /api/...
|
||||||
app.use("/api/events", eventRouter);
|
app.use("/api/events", eventRouter);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user