k586.jp

Cloudflare Workers & さくらのレンタルサーバ の構成に変更中

Cloudflare Workers に入門しました。あとマークダウン実装はとりあえず Marked.js + Prism.js + Mermaid.js です。がんばりがんばり。前回言っていた XML を読み込む型式はやめました。

マークダウンのテスト

ああああ、テストテスト

  • 1
  • 2
  • 3
import { Hono, Context as c } from 'hono';

function main() {

    const app = new Hono();
    const page = new Hono();

    page.get('/', indexHtml);

    app.route('/', page);

    return app;

}
export default main();


async function indexHtml(context: c) {
    const url = new URL('/index.html', 'https://example.com');
    const response = await context.env.ASSETS.fetch(url);
    const html = await response.text();
    return context.html(html);
}
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;