随笔分类 - bun
摘要:Bun 本身内置了强大的打包/编译能力,能直接将 ElysiaJS 项目打包成无需依赖 Bun 运行时的单个可执行文件,下面我会一步步教你完整实现流程。 一、前置条件 确保你的开发环境满足: 已安装 Bun(推荐最新稳定版,执行 bun upgrade 可更新) 已有 ElysiaJS 项目(无项目
阅读全文
摘要:index.ts: // this becomes an internal file path import html from "./index.html" with { type: "file" }; import { file } from "bun"; export default { fe
阅读全文
摘要:import { Elysia } from 'elysia' const app = new Elysia() .get('/ok', function* () { yield 1 yield 2 yield 3 }) .listen(3000)
阅读全文
摘要:server.ts: import { serve } from "bun"; const id = Math.random().toString(36).slice(2); serve({ port: process.env.PORT || 8080, development: false, //
阅读全文

浙公网安备 33010602011771号