https://github.com/intpfx/fx
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/intpfx/fx
- Owner: intpfx
- Created: 2024-11-08T13:44:54.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-09T05:15:47.000Z (6 months ago)
- Last Synced: 2025-03-28T20:51:23.022Z (about 2 months ago)
- Language: TypeScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
一个极其简单的快速开发套件。
以下是用法案例:
```javascript
import { CI, CMJS, roadmap, STDM } from "jsr:@intpfx/fx";
// import { CI, CMJS, roadmap, STDM } from "npm:@intpfx/fx";// 强制转换至部署模式,会取消HMR功能的注入,主要用于非Deno Deploy环境部署时使用
STDM();// 自定义入口索引HTML模板内容
CI({
title: "Hello, World!",
});// 自定义入口JS模板内容
CMJS(() => {
console.log("Hello, World!");
});// 添加API端点
roadmap.mark("test", async (messages) => {
const { request, headers } = messages;
const { key = null } = await request.json();
const result = key ? "success" : "failure";
headers.set("Content-Type", "application/json");
return new Response(JSON.stringify({ message: result }));
});
```