Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
A description of Hono Prepared Router
Search
EdamAmex
December 20, 2024
Technology
0
68
A description of Hono Prepared Router
A description of Hono Prepared Router
EdamAmex
December 20, 2024
Tweet
Share
Other Decks in Technology
See All in Technology
プロダクトのコードから見るGoによるデザインパターンの実践 #go_night_talk
bengo4com
1
2.7k
Claude Codeを駆使した初めてのiOSアプリ開発 ~ゼロから3週間でグローバルハッカソンで入賞するまで~
oikon48
10
5.2k
物体検出モデルでシイタケの収穫時期を自動判定してみた。 #devio2025
lamaglama39
0
250
HonoとJSXを使って管理画面をサクッと型安全に作ろう
diggymo
0
140
AIフル活用で挑む!空間アプリ開発のリアル
taat
0
110
Performance Insights 廃止から Database Insights 利用へ/transition-from-performance-insights-to-database-insights
emiki
0
340
Copilot Studio ハンズオン - 生成オーケストレーションモード
tomoyasasakimskk
0
160
エンタメとAIのための3Dパラレルワールド構築(GPU UNITE 2025 特別講演)
pfn
PRO
0
600
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
940
CNCFの視点で捉えるPlatform Engineering - 最新動向と展望 / Platform Engineering from the CNCF Perspective
hhiroshell
0
110
難しいセキュリティ用語をわかりやすくしてみた
yuta3110
0
340
Databricks AI/BI Genie の「値ディクショナリー」をAmazonの奥地(S3)まで見に行く
kameitomohiro
1
340
Featured
See All Featured
Writing Fast Ruby
sferik
629
62k
Side Projects
sachag
455
43k
Docker and Python
trallard
46
3.6k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
A designer walks into a library…
pauljervisheath
209
24k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Agile that works and the tools we love
rasmusluckow
331
21k
Into the Great Unknown - MozCon
thekraken
40
2.1k
GitHub's CSS Performance
jonrohan
1032
470k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
990
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
KATA
mclloyd
PRO
32
15k
Transcript
Prepared Router
Process of Build 1. Lexer Path 2. Generate Conditions 3.
Rollup and Optimize 4. Dynamic Prediction
1. Lexer Path /book/:id /book/:id/:page{\\d+} /search/* separator static dynamic regex
wildcard analyze the routing path 2. Generate Conditions pathParts is an array separated by separators. pathParts[1] = ‘book’ !!pathParts[2] ... /\d+/.test(pathParts[3]) ... pathParts.length > 2 ... And generate params
3. Rollup and Optimize if (A) { if (B) {
... } } if (C) { if (A) { ... } } optimize conditions if (A) { if (B) { ... } if (C) { ... } } if B and C are exclusive (B⊕C) if (A) { if (B) { ... }else if (C) { ... } }
4. Dynamic Prediction cache static path POST /books/list This is
static path Routing with built matcher and cache the results const results = matcher(“POST”, “/books/list”, ...) // [/books/*, /books/list] cache(“POST”, “/books/list”, results)