@@ -32,7 +32,6 @@ import RedisStore from 'connect-redis'
3232import { createClient } from 'redis'
3333import express from 'express'
3434import type { Application } from 'express'
35- import { useExpressServer , useContainer } from 'routing-controllers'
3635import { Container } from 'typedi'
3736import path from 'path'
3837import { execSync } from 'child_process'
@@ -41,20 +40,14 @@ import { OAuth2ProviderManager } from './services/OAuth2ProviderManager.js'
4140import { fileURLToPath } from 'url'
4241import { dirname } from 'path'
4342
44- // Import controllers
45- import { OpeyController } from './controllers/OpeyIIController.js'
46- import { OBPController } from './controllers/RequestController.js'
47- import { StatusController } from './controllers/StatusController.js'
48- import { UserController } from './controllers/UserController.js'
49- import { OAuth2CallbackController } from './controllers/OAuth2CallbackController.js'
50- import { OAuth2ConnectController } from './controllers/OAuth2ConnectController.js'
51- import { OAuth2ProvidersController } from './controllers/OAuth2ProvidersController.js'
43+ // Controllers removed - all routes migrated to plain Express
5244
5345// Import routes (plain Express, not routing-controllers)
5446import oauth2Routes from './routes/oauth2.js'
5547import userRoutes from './routes/user.js'
5648import statusRoutes from './routes/status.js'
5749import obpRoutes from './routes/obp.js'
50+ import opeyRoutes from './routes/opey.js'
5851
5952// ES module equivalent of __dirname
6053const __filename = fileURLToPath ( import . meta. url )
@@ -143,7 +136,6 @@ if (app.get('env') === 'production') {
143136 sessionObject . cookie . secure = true // serve secure cookies
144137}
145138app . use ( session ( sessionObject ) )
146- useContainer ( Container )
147139
148140// Initialize OAuth2 Service
149141console . log ( `--- OAuth2/OIDC setup -------------------------------------------` )
@@ -228,23 +220,20 @@ let instance: any
228220
229221 const routePrefix = '/api'
230222
231- // Register routes BEFORE routing-controllers (plain Express)
223+ // Register all routes (plain Express)
232224 app . use ( routePrefix , oauth2Routes )
233225 app . use ( routePrefix , userRoutes )
234226 app . use ( routePrefix , statusRoutes )
235227 app . use ( routePrefix , obpRoutes )
228+ app . use ( routePrefix , opeyRoutes )
236229 console . log ( 'OAuth2 routes registered (plain Express)' )
237230 console . log ( 'User routes registered (plain Express)' )
238231 console . log ( 'Status routes registered (plain Express)' )
239232 console . log ( 'OBP routes registered (plain Express)' )
233+ console . log ( 'Opey routes registered (plain Express)' )
234+ console . log ( 'All routes migrated to plain Express - routing-controllers removed' )
240235
241- const server = useExpressServer ( app , {
242- routePrefix : routePrefix ,
243- controllers : [ OpeyController ] ,
244- middlewares : [ ]
245- } )
246-
247- instance = server . listen ( port )
236+ instance = app . listen ( port )
248237
249238 console . log (
250239 `Backend is running. You can check a status at http://localhost:${ port } ${ routePrefix } /status`
0 commit comments