Files
cf-favicon/src/App.tsx
2026-06-24 22:10:24 +08:00

54 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export default function App() {
return (
<>
<h1>Favicon API</h1>
<p>
HTTP API favicon使 <strong>Google</strong>
<strong>DuckDuckGo</strong> <strong></strong>
Bing favicon
API DuckDuckGo
</p>
<h2></h2>
<p>GET </p>
<ul>
<li>
<code>url</code> <code>domain</code> <code>u</code>
</li>
<li>
<code>size</code>16256 128 Google
</li>
</ul>
<h2></h2>
<div className="example">
<code>/api/favicon?url=https://twitter.com</code>
<br />
<img
src="/api/favicon?url=https://twitter.com"
alt="twitter"
width={32}
height={32}
/>
</div>
<div className="example">
<code>/api/favicon?domain=github.com&amp;size=64</code>
<br />
<img
src="/api/favicon?domain=github.com&size=64"
alt="github"
width={64}
height={64}
/>
</div>
<h2></h2>
<pre>
GET https://你的 Workers 域名/api/favicon?url=https://example.com
</pre>
<p> 400/502 JSON </p>
</>
);
}