Color mode

Search notes

Filter with tag:, lang:, or path:.

エンドポイント(Endpoint)

エンドポイントは、プラグインが使える再利用可能なHTTPの振る舞いを宣言します。インテグレーションがエンドポイントの取り決めをホストのルーターに接続するため、プラグイン自体にフレームワーク固有のルーティングを埋め込む必要はありません。

エンドポイントの定義

ts
import { defineEndpoint } from "@riebeckite/core";
 
const searchEndpoint = defineEndpoint(
  "/search-data.json",
  ({ config, manifest }) => ({ json: buildSearchItems({ config, manifest }) }),
  { cacheControl: "public, max-age=300" },
);

インテグレーションとの接続

インテグレーションがエンドポイントの取り決めをホストのルーターに接続します。プラグイン自体に特定のルーター実装(HonoXなど)を埋め込まないでください。

関連用語

さらに詳しく

Local Graph

Nearby Notes

Open in Explorer →
エンドポイント(Endpoint)プラグイン(Plugin)アイランド(Island)クライアントエントリ(Client Entry)プラグイン依存関係(Plugin Dependency)レンダラー(Renderer)
CurrentOutgoingBacklink