Skip to content

Commit 41767cd

Browse files
committed
smallfix
1 parent e2d94d3 commit 41767cd

2 files changed

Lines changed: 13 additions & 130 deletions

File tree

src/app.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ const receiveAuthInfo = (c: HonoContext): AuthInfo | null => {
2626

2727

2828
const app = new Hono();
29-
app.use(federation(fedi, () => undefined));
30-
app.use(cors({
31-
origin: "*",
32-
allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
33-
allowHeaders: ["Content-Type", "Authorization"],
34-
}));
3529

3630
interface ApServerInfo {
3731
serviceAccountId: string
@@ -54,11 +48,24 @@ const ccEndpoints: Record<string, string> = {
5448
"net.concrnt.activitypub.resolve": "/ap/api/resolve?uri={uri}",
5549
};
5650

51+
// 以下2つは定期ポーリングされるため、fedifyミドルウェアより前に登録して
52+
// fedify·federation·http のアクセスログ(毎リクエストINFO)に乗せない。
53+
5754
// concrnt本体が services 登録済みサービスへ直接ポーリングするサービス広告
5855
app.get("/cc-info", (c) =>
5956
c.json({ name: pkg.name, version: pkg.version, endpoints: ccEndpoints })
6057
);
6158

59+
// livenessProbe用ヘルスチェック
60+
app.get("/health", (c) => c.json({ status: "ok" }));
61+
62+
app.use(federation(fedi, () => undefined));
63+
app.use(cors({
64+
origin: "*",
65+
allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
66+
allowHeaders: ["Content-Type", "Authorization"],
67+
}));
68+
6269
app.get("/ap", (c) => c.text("Hello, Fedify!"));
6370

6471
app.get("/ap/api/info", async (c) => {
@@ -71,17 +78,6 @@ app.get("/ap/api/info", async (c) => {
7178
});
7279

7380

74-
75-
app.get("/ap/test", async (c) => {
76-
77-
const authInfo = receiveAuthInfo(c);
78-
79-
return c.json({
80-
message: "Hello from the API!",
81-
authInfo,
82-
});
83-
});
84-
8581
app.post("/ap/api/setup", async (c) => {
8682

8783
const authInfo = receiveAuthInfo(c)

verify-410.tmp.mts

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)