@kubohiroya/turbowarp-http-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/LICENSE +373 -0
  2. package/README.ja.md +346 -0
  3. package/README.md +874 -0
  4. package/dist/auth/digest-file.d.ts +17 -0
  5. package/dist/auth/digest-file.js +90 -0
  6. package/dist/auth/digest-file.js.map +1 -0
  7. package/dist/auth/digest.d.ts +23 -0
  8. package/dist/auth/digest.js +139 -0
  9. package/dist/auth/digest.js.map +1 -0
  10. package/dist/cli.d.ts +1 -0
  11. package/dist/cli.js +156 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/community.d.ts +81 -0
  14. package/dist/community.js +689 -0
  15. package/dist/community.js.map +1 -0
  16. package/dist/digest-cli.d.ts +1 -0
  17. package/dist/digest-cli.js +159 -0
  18. package/dist/digest-cli.js.map +1 -0
  19. package/dist/extension-manifest.json +441 -0
  20. package/dist/protocol.d.ts +59 -0
  21. package/dist/protocol.js +71 -0
  22. package/dist/protocol.js.map +1 -0
  23. package/dist/server.d.ts +89 -0
  24. package/dist/server.js +650 -0
  25. package/dist/server.js.map +1 -0
  26. package/dist/turbowarp-http-server.js +1110 -0
  27. package/docs/deployment-targets.ja.md +274 -0
  28. package/docs/turbowarp-http-server.architecture.html +15149 -0
  29. package/docs/turbowarp-http-server.architecture.json +1014 -0
  30. package/docs/turbowarp-http-server.architecture.visual-check.1440x900.dark.png +0 -0
  31. package/docs/turbowarp-http-server.architecture.visual-check.1440x900.light.png +0 -0
  32. package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.dark.png +0 -0
  33. package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.light.png +0 -0
  34. package/docs/turbowarp-http-server.architecture.visual-check.html +32 -0
  35. package/docs/turbowarp-http-server.architecture.visual-check.json +547 -0
  36. package/examples/01-hello-form/README.ja.md +46 -0
  37. package/examples/01-hello-form/server.mjs +59 -0
  38. package/examples/02-visitor-counter/README.ja.md +39 -0
  39. package/examples/02-visitor-counter/server.mjs +44 -0
  40. package/examples/03-message-board/README.ja.md +47 -0
  41. package/examples/03-message-board/server.mjs +72 -0
  42. package/examples/04-image-upload/README.ja.md +46 -0
  43. package/examples/04-image-upload/server.mjs +149 -0
  44. package/examples/05-live-camera/README.ja.md +47 -0
  45. package/examples/05-live-camera/server.mjs +147 -0
  46. package/examples/06-scratch-like-community/README.ja.md +82 -0
  47. package/examples/06-scratch-like-community/server.mjs +17 -0
  48. package/examples/README.ja.md +20 -0
  49. package/package.json +75 -0
  50. package/schemas/extension-manifest.schema.json +49 -0
  51. package/src/auth/digest-file.ts +115 -0
  52. package/src/auth/digest.ts +170 -0
  53. package/src/block-definitions.json +417 -0
  54. package/src/cli.ts +172 -0
  55. package/src/community.ts +815 -0
  56. package/src/config.ts +12 -0
  57. package/src/digest-cli.ts +178 -0
  58. package/src/extension-manifest.ts +149 -0
  59. package/src/extension.ts +713 -0
  60. package/src/globals.d.ts +30 -0
  61. package/src/index.ts +8 -0
  62. package/src/protocol.ts +132 -0
  63. package/src/server.ts +880 -0
@@ -0,0 +1,32 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>Archify visual-check · turbowarp-http-server.architecture.html</title>
7
+ <style>
8
+ *{box-sizing:border-box}body{margin:0;padding:24px;background:#e9eef5;color:#172033;font:14px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}header{max-width:1500px;margin:0 auto 18px}h1{margin:0 0 6px;font-size:20px}p{margin:0;color:#526176}.grid{max-width:1500px;margin:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}figure{margin:0;padding:10px;background:white;border:1px solid #c9d4e3;border-radius:12px;box-shadow:0 10px 30px rgba(15,23,42,.08)}img{display:block;width:100%;height:auto;border:1px solid #e2e8f0}figcaption{padding:9px 4px 2px;color:#526176}@media(max-width:900px){.grid{grid-template-columns:1fr}}
9
+ </style>
10
+ </head>
11
+ <body>
12
+ <header><h1>Archify visual-check</h1><p>turbowarp-http-server.architecture.html · automated containment pass · visual review pending</p></header>
13
+ <main class="grid">
14
+ <figure>
15
+ <img src="turbowarp-http-server.architecture.visual-check.1440x900.light.png" alt="light 1440 by 900">
16
+ <figcaption><strong>LIGHT</strong> · 1440×900 · containment pass</figcaption>
17
+ </figure>
18
+ <figure>
19
+ <img src="turbowarp-http-server.architecture.visual-check.1440x900.dark.png" alt="dark 1440 by 900">
20
+ <figcaption><strong>DARK</strong> · 1440×900 · containment pass</figcaption>
21
+ </figure>
22
+ <figure>
23
+ <img src="turbowarp-http-server.architecture.visual-check.2048x1320.light.png" alt="light 2048 by 1320">
24
+ <figcaption><strong>LIGHT</strong> · 2048×1320 · containment pass</figcaption>
25
+ </figure>
26
+ <figure>
27
+ <img src="turbowarp-http-server.architecture.visual-check.2048x1320.dark.png" alt="dark 2048 by 1320">
28
+ <figcaption><strong>DARK</strong> · 2048×1320 · containment pass</figcaption>
29
+ </figure>
30
+ </main>
31
+ </body>
32
+ </html>
@@ -0,0 +1,547 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "ok": true,
4
+ "command": "visual-check",
5
+ "status": "pass",
6
+ "visualReview": "pending",
7
+ "artifact": {
8
+ "path": "/Users/hiroya/Dev/turbowarp-http-server/docs/turbowarp-http-server.architecture.html",
9
+ "sha256": "dba5f63981f662eb0b9f41fc212dcd62af6ddc543f09f276acd017958881be5a",
10
+ "bytes": 757734
11
+ },
12
+ "state": {
13
+ "detail": "read",
14
+ "motion": "still"
15
+ },
16
+ "chrome": {
17
+ "status": "available",
18
+ "executable": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
19
+ },
20
+ "diagnostics": [],
21
+ "containment": {
22
+ "status": "pass",
23
+ "viewports": [
24
+ {
25
+ "width": 1440,
26
+ "height": 900,
27
+ "theme": "light",
28
+ "innerWidth": 1440,
29
+ "innerHeight": 900,
30
+ "scrollWidth": 1440,
31
+ "scrollHeight": 900,
32
+ "overflowX": false,
33
+ "overflowY": false,
34
+ "ok": true,
35
+ "readerWidth": 1363,
36
+ "diagramWidth": 1333,
37
+ "viewBoxWidth": 1390,
38
+ "minimumProjectedNodeTextPx": 8.630935251798562,
39
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
40
+ "minimumProjectedNodeTextDetail": "context",
41
+ "minimumRequiredNodeTextPx": 6,
42
+ "readabilityOk": true,
43
+ "hasLegend": true,
44
+ "hasNavigationDock": true,
45
+ "legendDockIntersectionArea": 0,
46
+ "dockStageIntersectionArea": 0,
47
+ "dockStageGap": 10.21875,
48
+ "requiredDockStageGap": 10,
49
+ "viewerChromeStageOk": true,
50
+ "viewerChromeReserve": 51,
51
+ "viewerChromeActive": true,
52
+ "viewerChromeOk": true,
53
+ "resolvedTheme": "light"
54
+ },
55
+ {
56
+ "width": 1600,
57
+ "height": 1000,
58
+ "theme": "light",
59
+ "innerWidth": 1600,
60
+ "innerHeight": 1000,
61
+ "scrollWidth": 1600,
62
+ "scrollHeight": 1000,
63
+ "overflowX": false,
64
+ "overflowY": false,
65
+ "ok": true,
66
+ "readerWidth": 1447,
67
+ "diagramWidth": 1417,
68
+ "viewBoxWidth": 1390,
69
+ "minimumProjectedNodeTextPx": 9,
70
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
71
+ "minimumProjectedNodeTextDetail": "context",
72
+ "minimumRequiredNodeTextPx": 6,
73
+ "readabilityOk": true,
74
+ "hasLegend": true,
75
+ "hasNavigationDock": true,
76
+ "legendDockIntersectionArea": 0,
77
+ "dockStageIntersectionArea": 0,
78
+ "dockStageGap": 10.21875,
79
+ "requiredDockStageGap": 10,
80
+ "viewerChromeStageOk": true,
81
+ "viewerChromeReserve": 51,
82
+ "viewerChromeActive": true,
83
+ "viewerChromeOk": true,
84
+ "resolvedTheme": "light"
85
+ },
86
+ {
87
+ "width": 1920,
88
+ "height": 1080,
89
+ "theme": "light",
90
+ "innerWidth": 1920,
91
+ "innerHeight": 1080,
92
+ "scrollWidth": 1920,
93
+ "scrollHeight": 1080,
94
+ "overflowX": false,
95
+ "overflowY": false,
96
+ "ok": true,
97
+ "readerWidth": 1646,
98
+ "diagramWidth": 1616,
99
+ "viewBoxWidth": 1390,
100
+ "minimumProjectedNodeTextPx": 9,
101
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
102
+ "minimumProjectedNodeTextDetail": "context",
103
+ "minimumRequiredNodeTextPx": 6,
104
+ "readabilityOk": true,
105
+ "hasLegend": true,
106
+ "hasNavigationDock": true,
107
+ "legendDockIntersectionArea": 0,
108
+ "dockStageIntersectionArea": 0,
109
+ "dockStageGap": 10.21875,
110
+ "requiredDockStageGap": 10,
111
+ "viewerChromeStageOk": true,
112
+ "viewerChromeReserve": 51,
113
+ "viewerChromeActive": true,
114
+ "viewerChromeOk": true,
115
+ "resolvedTheme": "light"
116
+ },
117
+ {
118
+ "width": 2048,
119
+ "height": 1320,
120
+ "theme": "light",
121
+ "innerWidth": 2048,
122
+ "innerHeight": 1320,
123
+ "scrollWidth": 2048,
124
+ "scrollHeight": 1320,
125
+ "overflowX": false,
126
+ "overflowY": false,
127
+ "ok": true,
128
+ "readerWidth": 1920,
129
+ "diagramWidth": 1870,
130
+ "viewBoxWidth": 1390,
131
+ "minimumProjectedNodeTextPx": 9,
132
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
133
+ "minimumProjectedNodeTextDetail": "context",
134
+ "minimumRequiredNodeTextPx": 6,
135
+ "readabilityOk": true,
136
+ "hasLegend": true,
137
+ "hasNavigationDock": true,
138
+ "legendDockIntersectionArea": 0,
139
+ "dockStageIntersectionArea": 0,
140
+ "dockStageGap": 10.21875,
141
+ "requiredDockStageGap": 10,
142
+ "viewerChromeStageOk": true,
143
+ "viewerChromeReserve": 41,
144
+ "viewerChromeActive": true,
145
+ "viewerChromeOk": true,
146
+ "resolvedTheme": "light"
147
+ }
148
+ ]
149
+ },
150
+ "readability": {
151
+ "status": "pass",
152
+ "minimumProjectedNodeTextPx": 6,
153
+ "viewports": [
154
+ {
155
+ "width": 1440,
156
+ "height": 900,
157
+ "theme": "light",
158
+ "innerWidth": 1440,
159
+ "innerHeight": 900,
160
+ "scrollWidth": 1440,
161
+ "scrollHeight": 900,
162
+ "overflowX": false,
163
+ "overflowY": false,
164
+ "ok": true,
165
+ "readerWidth": 1363,
166
+ "diagramWidth": 1333,
167
+ "viewBoxWidth": 1390,
168
+ "minimumProjectedNodeTextPx": 8.630935251798562,
169
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
170
+ "minimumProjectedNodeTextDetail": "context",
171
+ "minimumRequiredNodeTextPx": 6,
172
+ "readabilityOk": true,
173
+ "hasLegend": true,
174
+ "hasNavigationDock": true,
175
+ "legendDockIntersectionArea": 0,
176
+ "dockStageIntersectionArea": 0,
177
+ "dockStageGap": 10.21875,
178
+ "requiredDockStageGap": 10,
179
+ "viewerChromeStageOk": true,
180
+ "viewerChromeReserve": 51,
181
+ "viewerChromeActive": true,
182
+ "viewerChromeOk": true,
183
+ "resolvedTheme": "light"
184
+ },
185
+ {
186
+ "width": 1600,
187
+ "height": 1000,
188
+ "theme": "light",
189
+ "innerWidth": 1600,
190
+ "innerHeight": 1000,
191
+ "scrollWidth": 1600,
192
+ "scrollHeight": 1000,
193
+ "overflowX": false,
194
+ "overflowY": false,
195
+ "ok": true,
196
+ "readerWidth": 1447,
197
+ "diagramWidth": 1417,
198
+ "viewBoxWidth": 1390,
199
+ "minimumProjectedNodeTextPx": 9,
200
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
201
+ "minimumProjectedNodeTextDetail": "context",
202
+ "minimumRequiredNodeTextPx": 6,
203
+ "readabilityOk": true,
204
+ "hasLegend": true,
205
+ "hasNavigationDock": true,
206
+ "legendDockIntersectionArea": 0,
207
+ "dockStageIntersectionArea": 0,
208
+ "dockStageGap": 10.21875,
209
+ "requiredDockStageGap": 10,
210
+ "viewerChromeStageOk": true,
211
+ "viewerChromeReserve": 51,
212
+ "viewerChromeActive": true,
213
+ "viewerChromeOk": true,
214
+ "resolvedTheme": "light"
215
+ },
216
+ {
217
+ "width": 1920,
218
+ "height": 1080,
219
+ "theme": "light",
220
+ "innerWidth": 1920,
221
+ "innerHeight": 1080,
222
+ "scrollWidth": 1920,
223
+ "scrollHeight": 1080,
224
+ "overflowX": false,
225
+ "overflowY": false,
226
+ "ok": true,
227
+ "readerWidth": 1646,
228
+ "diagramWidth": 1616,
229
+ "viewBoxWidth": 1390,
230
+ "minimumProjectedNodeTextPx": 9,
231
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
232
+ "minimumProjectedNodeTextDetail": "context",
233
+ "minimumRequiredNodeTextPx": 6,
234
+ "readabilityOk": true,
235
+ "hasLegend": true,
236
+ "hasNavigationDock": true,
237
+ "legendDockIntersectionArea": 0,
238
+ "dockStageIntersectionArea": 0,
239
+ "dockStageGap": 10.21875,
240
+ "requiredDockStageGap": 10,
241
+ "viewerChromeStageOk": true,
242
+ "viewerChromeReserve": 51,
243
+ "viewerChromeActive": true,
244
+ "viewerChromeOk": true,
245
+ "resolvedTheme": "light"
246
+ },
247
+ {
248
+ "width": 2048,
249
+ "height": 1320,
250
+ "theme": "light",
251
+ "innerWidth": 2048,
252
+ "innerHeight": 1320,
253
+ "scrollWidth": 2048,
254
+ "scrollHeight": 1320,
255
+ "overflowX": false,
256
+ "overflowY": false,
257
+ "ok": true,
258
+ "readerWidth": 1920,
259
+ "diagramWidth": 1870,
260
+ "viewBoxWidth": 1390,
261
+ "minimumProjectedNodeTextPx": 9,
262
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
263
+ "minimumProjectedNodeTextDetail": "context",
264
+ "minimumRequiredNodeTextPx": 6,
265
+ "readabilityOk": true,
266
+ "hasLegend": true,
267
+ "hasNavigationDock": true,
268
+ "legendDockIntersectionArea": 0,
269
+ "dockStageIntersectionArea": 0,
270
+ "dockStageGap": 10.21875,
271
+ "requiredDockStageGap": 10,
272
+ "viewerChromeStageOk": true,
273
+ "viewerChromeReserve": 41,
274
+ "viewerChromeActive": true,
275
+ "viewerChromeOk": true,
276
+ "resolvedTheme": "light"
277
+ }
278
+ ]
279
+ },
280
+ "viewerChrome": {
281
+ "status": "pass",
282
+ "viewports": [
283
+ {
284
+ "width": 1440,
285
+ "height": 900,
286
+ "theme": "light",
287
+ "innerWidth": 1440,
288
+ "innerHeight": 900,
289
+ "scrollWidth": 1440,
290
+ "scrollHeight": 900,
291
+ "overflowX": false,
292
+ "overflowY": false,
293
+ "ok": true,
294
+ "readerWidth": 1363,
295
+ "diagramWidth": 1333,
296
+ "viewBoxWidth": 1390,
297
+ "minimumProjectedNodeTextPx": 8.630935251798562,
298
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
299
+ "minimumProjectedNodeTextDetail": "context",
300
+ "minimumRequiredNodeTextPx": 6,
301
+ "readabilityOk": true,
302
+ "hasLegend": true,
303
+ "hasNavigationDock": true,
304
+ "legendDockIntersectionArea": 0,
305
+ "dockStageIntersectionArea": 0,
306
+ "dockStageGap": 10.21875,
307
+ "requiredDockStageGap": 10,
308
+ "viewerChromeStageOk": true,
309
+ "viewerChromeReserve": 51,
310
+ "viewerChromeActive": true,
311
+ "viewerChromeOk": true,
312
+ "resolvedTheme": "light"
313
+ },
314
+ {
315
+ "width": 1600,
316
+ "height": 1000,
317
+ "theme": "light",
318
+ "innerWidth": 1600,
319
+ "innerHeight": 1000,
320
+ "scrollWidth": 1600,
321
+ "scrollHeight": 1000,
322
+ "overflowX": false,
323
+ "overflowY": false,
324
+ "ok": true,
325
+ "readerWidth": 1447,
326
+ "diagramWidth": 1417,
327
+ "viewBoxWidth": 1390,
328
+ "minimumProjectedNodeTextPx": 9,
329
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
330
+ "minimumProjectedNodeTextDetail": "context",
331
+ "minimumRequiredNodeTextPx": 6,
332
+ "readabilityOk": true,
333
+ "hasLegend": true,
334
+ "hasNavigationDock": true,
335
+ "legendDockIntersectionArea": 0,
336
+ "dockStageIntersectionArea": 0,
337
+ "dockStageGap": 10.21875,
338
+ "requiredDockStageGap": 10,
339
+ "viewerChromeStageOk": true,
340
+ "viewerChromeReserve": 51,
341
+ "viewerChromeActive": true,
342
+ "viewerChromeOk": true,
343
+ "resolvedTheme": "light"
344
+ },
345
+ {
346
+ "width": 1920,
347
+ "height": 1080,
348
+ "theme": "light",
349
+ "innerWidth": 1920,
350
+ "innerHeight": 1080,
351
+ "scrollWidth": 1920,
352
+ "scrollHeight": 1080,
353
+ "overflowX": false,
354
+ "overflowY": false,
355
+ "ok": true,
356
+ "readerWidth": 1646,
357
+ "diagramWidth": 1616,
358
+ "viewBoxWidth": 1390,
359
+ "minimumProjectedNodeTextPx": 9,
360
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
361
+ "minimumProjectedNodeTextDetail": "context",
362
+ "minimumRequiredNodeTextPx": 6,
363
+ "readabilityOk": true,
364
+ "hasLegend": true,
365
+ "hasNavigationDock": true,
366
+ "legendDockIntersectionArea": 0,
367
+ "dockStageIntersectionArea": 0,
368
+ "dockStageGap": 10.21875,
369
+ "requiredDockStageGap": 10,
370
+ "viewerChromeStageOk": true,
371
+ "viewerChromeReserve": 51,
372
+ "viewerChromeActive": true,
373
+ "viewerChromeOk": true,
374
+ "resolvedTheme": "light"
375
+ },
376
+ {
377
+ "width": 2048,
378
+ "height": 1320,
379
+ "theme": "light",
380
+ "innerWidth": 2048,
381
+ "innerHeight": 1320,
382
+ "scrollWidth": 2048,
383
+ "scrollHeight": 1320,
384
+ "overflowX": false,
385
+ "overflowY": false,
386
+ "ok": true,
387
+ "readerWidth": 1920,
388
+ "diagramWidth": 1870,
389
+ "viewBoxWidth": 1390,
390
+ "minimumProjectedNodeTextPx": 9,
391
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
392
+ "minimumProjectedNodeTextDetail": "context",
393
+ "minimumRequiredNodeTextPx": 6,
394
+ "readabilityOk": true,
395
+ "hasLegend": true,
396
+ "hasNavigationDock": true,
397
+ "legendDockIntersectionArea": 0,
398
+ "dockStageIntersectionArea": 0,
399
+ "dockStageGap": 10.21875,
400
+ "requiredDockStageGap": 10,
401
+ "viewerChromeStageOk": true,
402
+ "viewerChromeReserve": 41,
403
+ "viewerChromeActive": true,
404
+ "viewerChromeOk": true,
405
+ "resolvedTheme": "light"
406
+ }
407
+ ]
408
+ },
409
+ "captures": {
410
+ "status": "pass",
411
+ "screenshots": [
412
+ {
413
+ "width": 1440,
414
+ "height": 900,
415
+ "theme": "light",
416
+ "innerWidth": 1440,
417
+ "innerHeight": 900,
418
+ "scrollWidth": 1440,
419
+ "scrollHeight": 900,
420
+ "overflowX": false,
421
+ "overflowY": false,
422
+ "ok": true,
423
+ "readerWidth": 1363,
424
+ "diagramWidth": 1333,
425
+ "viewBoxWidth": 1390,
426
+ "minimumProjectedNodeTextPx": 8.630935251798562,
427
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
428
+ "minimumProjectedNodeTextDetail": "context",
429
+ "minimumRequiredNodeTextPx": 6,
430
+ "readabilityOk": true,
431
+ "hasLegend": true,
432
+ "hasNavigationDock": true,
433
+ "legendDockIntersectionArea": 0,
434
+ "dockStageIntersectionArea": 0,
435
+ "dockStageGap": 10.21875,
436
+ "requiredDockStageGap": 10,
437
+ "viewerChromeStageOk": true,
438
+ "viewerChromeReserve": 51,
439
+ "viewerChromeActive": true,
440
+ "viewerChromeOk": true,
441
+ "resolvedTheme": "light",
442
+ "file": "turbowarp-http-server.architecture.visual-check.1440x900.light.png"
443
+ },
444
+ {
445
+ "width": 1440,
446
+ "height": 900,
447
+ "theme": "dark",
448
+ "innerWidth": 1440,
449
+ "innerHeight": 900,
450
+ "scrollWidth": 1440,
451
+ "scrollHeight": 900,
452
+ "overflowX": false,
453
+ "overflowY": false,
454
+ "ok": true,
455
+ "readerWidth": 1363,
456
+ "diagramWidth": 1333,
457
+ "viewBoxWidth": 1390,
458
+ "minimumProjectedNodeTextPx": 8.630935251798562,
459
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
460
+ "minimumProjectedNodeTextDetail": "context",
461
+ "minimumRequiredNodeTextPx": 6,
462
+ "readabilityOk": true,
463
+ "hasLegend": true,
464
+ "hasNavigationDock": true,
465
+ "legendDockIntersectionArea": 0,
466
+ "dockStageIntersectionArea": 0,
467
+ "dockStageGap": 10.21875,
468
+ "requiredDockStageGap": 10,
469
+ "viewerChromeStageOk": true,
470
+ "viewerChromeReserve": 51,
471
+ "viewerChromeActive": true,
472
+ "viewerChromeOk": true,
473
+ "resolvedTheme": "dark",
474
+ "file": "turbowarp-http-server.architecture.visual-check.1440x900.dark.png"
475
+ },
476
+ {
477
+ "width": 2048,
478
+ "height": 1320,
479
+ "theme": "light",
480
+ "innerWidth": 2048,
481
+ "innerHeight": 1320,
482
+ "scrollWidth": 2048,
483
+ "scrollHeight": 1320,
484
+ "overflowX": false,
485
+ "overflowY": false,
486
+ "ok": true,
487
+ "readerWidth": 1920,
488
+ "diagramWidth": 1870,
489
+ "viewBoxWidth": 1390,
490
+ "minimumProjectedNodeTextPx": 9,
491
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
492
+ "minimumProjectedNodeTextDetail": "context",
493
+ "minimumRequiredNodeTextPx": 6,
494
+ "readabilityOk": true,
495
+ "hasLegend": true,
496
+ "hasNavigationDock": true,
497
+ "legendDockIntersectionArea": 0,
498
+ "dockStageIntersectionArea": 0,
499
+ "dockStageGap": 10.21875,
500
+ "requiredDockStageGap": 10,
501
+ "viewerChromeStageOk": true,
502
+ "viewerChromeReserve": 41,
503
+ "viewerChromeActive": true,
504
+ "viewerChromeOk": true,
505
+ "resolvedTheme": "light",
506
+ "file": "turbowarp-http-server.architecture.visual-check.2048x1320.light.png"
507
+ },
508
+ {
509
+ "width": 2048,
510
+ "height": 1320,
511
+ "theme": "dark",
512
+ "innerWidth": 2048,
513
+ "innerHeight": 1320,
514
+ "scrollWidth": 2048,
515
+ "scrollHeight": 1320,
516
+ "overflowX": false,
517
+ "overflowY": false,
518
+ "ok": true,
519
+ "readerWidth": 1920,
520
+ "diagramWidth": 1870,
521
+ "viewBoxWidth": 1390,
522
+ "minimumProjectedNodeTextPx": 9,
523
+ "minimumProjectedNodeText": "Browser/fetch/LAN",
524
+ "minimumProjectedNodeTextDetail": "context",
525
+ "minimumRequiredNodeTextPx": 6,
526
+ "readabilityOk": true,
527
+ "hasLegend": true,
528
+ "hasNavigationDock": true,
529
+ "legendDockIntersectionArea": 0,
530
+ "dockStageIntersectionArea": 0,
531
+ "dockStageGap": 10.21875,
532
+ "requiredDockStageGap": 10,
533
+ "viewerChromeStageOk": true,
534
+ "viewerChromeReserve": 41,
535
+ "viewerChromeActive": true,
536
+ "viewerChromeOk": true,
537
+ "resolvedTheme": "dark",
538
+ "file": "turbowarp-http-server.architecture.visual-check.2048x1320.dark.png"
539
+ }
540
+ ],
541
+ "contactSheet": "turbowarp-http-server.architecture.visual-check.html"
542
+ },
543
+ "sidecars": {
544
+ "receipt": "turbowarp-http-server.architecture.visual-check.json",
545
+ "contactSheet": "turbowarp-http-server.architecture.visual-check.html"
546
+ }
547
+ }
@@ -0,0 +1,46 @@
1
+ # 01-hello-form
2
+
3
+ フォームに名前を入れると `こんにちは、名前!` と返す最小の HTTP server サンプルです。
4
+
5
+ ## 起動
6
+
7
+ ```bash
8
+ corepack pnpm exec tsx examples/01-hello-form/server.mjs
9
+ ```
10
+
11
+ ブラウザで `http://127.0.0.1:9101/` を開きます。
12
+
13
+ ## HTTP route
14
+
15
+ | Method | Path | 期待されるレスポンス |
16
+ |---|---|---|
17
+ | `GET` | `/` | 名前入力フォームの HTML |
18
+ | `POST` | `/hello` | `こんにちは、名前!` を含む HTML |
19
+
20
+ ## TurboWarp 側のブロック構成
21
+
22
+ ```text
23
+ when HTTP request received
24
+ use HTTP request [current request ID]
25
+ if <current HTTP method = [GET] and current request path = [/]> then
26
+ new HTML element [form]
27
+ HTML [form] set attribute [method] to [post]
28
+ HTML [form] set attribute [action] to [/hello]
29
+ ... input/button を追加 ...
30
+ respond with HTML [render HTML document title [Hello] body [form]]
31
+ end
32
+
33
+ if <current HTTP method = [POST] and current request path = [/hello]> then
34
+ name = form body から取り出した値
35
+ respond with HTML [こんにちは、name!]
36
+ end
37
+ ```
38
+
39
+ ## 動作確認
40
+
41
+ ```bash
42
+ curl -i http://127.0.0.1:9101/
43
+ curl -i -X POST http://127.0.0.1:9101/hello \
44
+ -H 'content-type: application/x-www-form-urlencoded' \
45
+ --data 'name=太郎'
46
+ ```