@@ -26,12 +26,6 @@ const receiveAuthInfo = (c: HonoContext): AuthInfo | null => {
2626
2727
2828const 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
3630interface 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 登録済みサービスへ直接ポーリングするサービス広告
5855app . 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+
6269app . get ( "/ap" , ( c ) => c . text ( "Hello, Fedify!" ) ) ;
6370
6471app . 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-
8581app . post ( "/ap/api/setup" , async ( c ) => {
8682
8783 const authInfo = receiveAuthInfo ( c )
0 commit comments