|
@@ -3,6 +3,7 @@ import { errorHandler } from './utils/errorHandler'
|
|
|
import usersRouter from './api/users/index'
|
|
import usersRouter from './api/users/index'
|
|
|
import authRoute from './api/auth/index'
|
|
import authRoute from './api/auth/index'
|
|
|
import rolesRoute from './api/roles/index'
|
|
import rolesRoute from './api/roles/index'
|
|
|
|
|
+import publicRoute from './api/public/index';
|
|
|
import postsRouter from './api/posts/index'
|
|
import postsRouter from './api/posts/index'
|
|
|
import { AuthContext } from './types/context'
|
|
import { AuthContext } from './types/context'
|
|
|
import { AppDataSource } from './data-source'
|
|
import { AppDataSource } from './data-source'
|
|
@@ -55,10 +56,13 @@ const userRoutes = api.route('/api/v1/users', usersRouter)
|
|
|
const authRoutes = api.route('/api/v1/auth', authRoute)
|
|
const authRoutes = api.route('/api/v1/auth', authRoute)
|
|
|
const roleRoutes = api.route('/api/v1/roles', rolesRoute)
|
|
const roleRoutes = api.route('/api/v1/roles', rolesRoute)
|
|
|
const postRoutes = api.route('/api/v1/posts', postsRouter)
|
|
const postRoutes = api.route('/api/v1/posts', postsRouter)
|
|
|
|
|
+// 注册公共路由
|
|
|
|
|
+const publicRoutes = api.route('/api/v1/public', publicRoute);
|
|
|
|
|
|
|
|
export type AuthRoutes = typeof authRoutes
|
|
export type AuthRoutes = typeof authRoutes
|
|
|
export type UserRoutes = typeof userRoutes
|
|
export type UserRoutes = typeof userRoutes
|
|
|
export type RoleRoutes = typeof roleRoutes
|
|
export type RoleRoutes = typeof roleRoutes
|
|
|
export type PostRoutes = typeof postRoutes
|
|
export type PostRoutes = typeof postRoutes
|
|
|
|
|
+export type PublicRoutes = typeof publicRoutes
|
|
|
|
|
|
|
|
export default api
|
|
export default api
|