Skip to content
项目

关于

一个介绍计算机科学和 Web 开发的互动博客 💡

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
+1

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Not a Number

Interactive blog posts on computer science and web development, at nan.fyi.

Built with React Router (framework mode), MDX and Tailwind CSS, and deployed to Cloudflare Workers — the same stack as the nan repo.

pnpm install
pnpm dev

Layout

  • app/routes.ts lists every route. Pages live under app/routes/, each with a route.tsx (meta + layout) and usually a page.mdx (the post).
  • app/mdx-components.tsx maps the components every MDX page can use.
  • app/routes/api/ holds the newsletter endpoints.
  • workers/app.ts is the Worker entry; wrangler.json configures it.

See migration.md for how to add an article.

Secrets and bindings

The newsletter sign-up (/api/subscribe, /api/verify) needs one secret, LOOPS_API_KEY. For local development copy .dev.vars.example to .dev.vars and fill it in; in production set it with wrangler secret put LOOPS_API_KEY.

Confirmation tokens are stored in the SUBSCRIBE_TOKENS Workers KV namespace (see wrangler.json). Wrangler creates the namespace on the first deploy; local dev uses a local KV store.

Scripts

Script
pnpm dev Dev server
pnpm build Production build
pnpm preview Build, then serve the built Worker locally
pnpm deploy Deploy to Cloudflare (wrangler deploy)
pnpm typecheck Generate types and run tsc
pnpm test Vitest

探索相关项目

加载中…