You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
721 B
26 lines
721 B
/**
|
|
* 路由注册管理
|
|
*/
|
|
|
|
import { app } from './app.js'
|
|
import { autoRegisterControllers } from '../../shared/helpers/routeHelper.js'
|
|
import { resolve } from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
import path from 'path'
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
/**
|
|
* 注册所有路由
|
|
*/
|
|
export function registerRoutes() {
|
|
// 自动注册控制器路由
|
|
const controllersPath = resolve(__dirname, '../../modules')
|
|
autoRegisterControllers(app, controllersPath)
|
|
|
|
// 注册共享控制器
|
|
const sharedControllersPath = resolve(__dirname, '../../modules/shared/controllers')
|
|
autoRegisterControllers(app, sharedControllersPath)
|
|
}
|
|
|
|
export default registerRoutes
|