Skip to content

Commit 33a675f

Browse files
authored
Merge pull request #82 from ungdev/default-route
Default route
2 parents a65de98 + 23771c3 commit 33a675f

5 files changed

Lines changed: 60 additions & 42 deletions

File tree

‎backend/package-lock.json‎

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎backend/server.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import bodyParser from 'body-parser';
55
import dotenv from 'dotenv';
66
import path from "path";
77

8+
import defaultRoute from './src/routes/default.routes';
89
import authRoutes from './src/routes/auth.routes';
910
import roleRoutes from './src/routes/role.routes';
1011
import userRoutes from './src/routes/user.routes';
@@ -46,6 +47,7 @@ async function startServer() {
4647
console.log('Base de données initialisée avec succès');
4748

4849
// Utilisation des routes d'authentification
50+
app.use('/api', defaultRoute)
4951
app.use('/api/auth', authRoutes);
5052
app.use('/api/authadmin',authenticateUser, authRoutes);
5153
app.use('/api/role',authenticateUser, roleRoutes);
@@ -76,4 +78,4 @@ async function startServer() {
7678
}
7779
}
7880

79-
startServer();
81+
startServer();
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Request, Response } from 'express';
2+
import express from 'express';
3+
4+
const defaultRouter = express.Router();
5+
6+
defaultRouter.get('/', (req: Request, res: Response) => {
7+
res.json({ status: 'ok' })
8+
})
9+
10+
export default defaultRouter

‎backend/tsconfig.json‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"compilerOptions": {
3-
"typeRoots": ["./types", "./node_modules/@types"],
4-
"strict": false,
5-
"target": "ES2020",
6-
"module": "node16",
7-
"moduleResolution": "node16",
8-
"esModuleInterop": true,
9-
"skipLibCheck": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"outDir": "./dist",
12-
"resolveJsonModule": true
13-
},
14-
"include": ["src/**/*.ts"],
15-
"exclude": ["node_modules"]
16-
}
17-
2+
"compilerOptions": {
3+
"typeRoots": ["./types", "./node_modules/@types"],
4+
"strict": false,
5+
"target": "ES2020",
6+
"module": "node16",
7+
"moduleResolution": "node16",
8+
"esModuleInterop": true,
9+
"skipLibCheck": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"rootDir": "./src",
12+
"outDir": "./dist",
13+
"resolveJsonModule": true
14+
},
15+
"include": ["src/**/*.ts"],
16+
"exclude": ["node_modules"]
17+
}

‎frontend/package-lock.json‎

Lines changed: 17 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)