auth frontend
This commit is contained in:
@@ -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
14
server/src/routes/auth.ts
Normal 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;
|
||||
Reference in New Issue
Block a user