Skip to content

Commit

Permalink
fix: 没有注册 route
Browse files Browse the repository at this point in the history
  • Loading branch information
SALTWOOD committed Jan 21, 2025
1 parent 7d297d0 commit 0d5dc34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/routes/RouteFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { IDatabase } from '../database/IDatabase.js';
import { RouteComment } from './RouteComment.js';
import { RouteRoot } from './RouteRoot.js';
import { RouteNotification } from './RouteNotification.js';
import { RouteFriends } from './RouteFriends.js';

export class RouteFactory {
public app: Express;
Expand All @@ -36,5 +37,6 @@ export class RouteFactory {
RouteComment.register(this);
RouteRoot.register(this);
RouteNotification.register(this);
RouteFriends.register(this);
}
}
2 changes: 1 addition & 1 deletion src/routes/RouteFriends.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FriendLink } from "../database/FriendLink.js";
import { RouteFactory } from "./RouteFactory.js";

class RouteFriends {
export class RouteFriends {
public static register(inst: RouteFactory) {
inst.app.get("/api/friends", async (req, res) => {
const friends = await inst.db.getEntities<FriendLink>(FriendLink);
Expand Down

0 comments on commit 0d5dc34

Please sign in to comment.