One port, different response paths. HTTP entry API routes → JSON Static files → HTML / assets Non-API misses fall back to the SPA shell. Fastify 生产静态服务:同端口、SPA fallback 与失败路径 核对 ChatCrystal 的实际构建与静态目录探测,用隔离 inject 练习验证页面、未知 API 和缺失资源的不同响应。 曾亮懿 2026年10月5日 阅读约 4 分钟 #ChatCrystal #Fastify #Node.js
Register. Validate. Check. Route plugin Input schema inject() scope valid / invalid 200 / 400 / 404 Verify the failure path. 从 ChatCrystal 学 Fastify:插件、校验与失败路径 对照真实 createServer 与路由边界,在隔离练习中运行 Fastify inject,验证成功、无效输入和不存在的路由。 曾亮懿 2026年10月4日 阅读约 3 分钟 #ChatCrystal #Fastify #Node.js