1
- import express , { Express , Request , Response } from 'express' ;
1
+ import express , { Express , Request , Response , Router } from 'express' ;
2
2
import cors from 'cors' ;
3
3
import helmet from 'helmet' ;
4
4
import morgan from 'morgan' ;
@@ -12,11 +12,13 @@ import { fileURLToPath } from 'url';
12
12
import rfs from 'rotating-file-stream' ;
13
13
14
14
import { config , policies } from './config/config.js' ;
15
+ import { authRoutes } from './routes/auth.js' ;
16
+ import { userRoutes } from './routes/user.js' ;
17
+ import { contentRoutes } from './routes/content.js' ;
15
18
16
19
import { errorHandler } from "./helpers/error.mw.js" ;
17
20
import { notFoundHandler } from "./helpers/not-found.mw.js" ;
18
- import routes from './routes/index.js' ;
19
-
21
+ //import routes from './routes/index.js';
20
22
21
23
export default class App {
22
24
@@ -56,10 +58,13 @@ export default class App {
56
58
console . log ( '::: logfile is at: logs/access.log' ) ;
57
59
this . app . use ( morgan ( 'tiny' , { stream : accessLogStream } ) )
58
60
}
59
- this . app . use ( errorHandler ) ;
60
- this . app . use ( notFoundHandler ) ;
61
+ // this.app.use(errorHandler);
62
+ // this.app.use(notFoundHandler);
63
+
64
+ this . app . use ( '/auth' , authRoutes ) ;
65
+ this . app . use ( '/user' , userRoutes ) ;
66
+ this . app . use ( '/content' , contentRoutes ) ;
61
67
62
- this . app . use ( '/' , routes ) ;
63
68
console . log ( ':::--------------------------------' ) ;
64
69
65
70
this . app . listen ( config . port , ( ) => {
0 commit comments