auth frontend

This commit is contained in:
eneller
2026-03-07 13:53:46 +01:00
parent 3300622191
commit 111d1a7b48
6 changed files with 30 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
import express, { Express, Request, Response } from "express";
import cors from "cors";
import transactionsRouter from './routes/transactions';
import authRouter from './routes/auth';
import { db, testConnection } from "./util/db";
import { logger } from "./util/logging";
@@ -13,6 +14,7 @@ app.get("/api/health", (req: Request, res: Response) => {
});
app.use('/api/transactions', transactionsRouter);
app.use('/api/auth', authRouter);
const PORT: number = parseInt(process.env.PORT as string) || 3000;

14
server/src/routes/auth.ts Normal file
View File

@@ -0,0 +1,14 @@
import express from 'express';
const router = express.Router();
router.post('/login', async (req, res) => {
try {
res.json('abc');
} catch (err) {
console.error('Failed to authenticate:', err);
res.status(500).json({ error: 'Failed to authenticate' });
}
});
export default router;