@@ -6,9 +6,8 @@ import { EventRouter } from '@api/integrations/event/event.router';
66import { configService } from '@config/env.config' ;
77import { Router } from 'express' ;
88import fs from 'fs' ;
9- import mime from 'mime' ;
10- import path from 'path' ;
119
10+ import { CallRouter } from './call.router' ;
1211import { ChatRouter } from './chat.router' ;
1312import { GroupRouter } from './group.router' ;
1413import { InstanceRouter } from './instance.router' ;
@@ -35,20 +34,6 @@ const telemetry = new Telemetry();
3534
3635const packageJson = JSON . parse ( fs . readFileSync ( './package.json' , 'utf8' ) ) ;
3736
38- router . get ( '/assets/*' , ( req , res ) => {
39- const fileName = req . params [ 0 ] ;
40- const basePath = path . join ( process . cwd ( ) , 'manager' , 'dist' ) ;
41-
42- const filePath = path . join ( basePath , 'assets/' , fileName ) ;
43-
44- if ( fs . existsSync ( filePath ) ) {
45- res . set ( 'Content-Type' , mime . getType ( filePath ) || 'text/css' ) ;
46- res . send ( fs . readFileSync ( filePath ) ) ;
47- } else {
48- res . status ( 404 ) . send ( 'File not found' ) ;
49- }
50- } ) ;
51-
5237router
5338 . use ( ( req , res , next ) => telemetry . collectTelemetry ( req , res , next ) )
5439
7257 } )
7358 . use ( '/instance' , new InstanceRouter ( configService , ...guards ) . router )
7459 . use ( '/message' , new MessageRouter ( ...guards ) . router )
60+ . use ( '/call' , new CallRouter ( ...guards ) . router )
7561 . use ( '/chat' , new ChatRouter ( ...guards ) . router )
7662 . use ( '/group' , new GroupRouter ( ...guards ) . router )
7763 . use ( '/template' , new TemplateRouter ( configService , ...guards ) . router )
0 commit comments