Skip to content
Agentmart
Submit a tool

fc-nodejs-website

Build and deploy a Node.js website/app on the function-compute service (Aliyun FC 3.0 built-in nodejs20 runtime).

Skill by Reyvic925

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/reyvic925-fc-nodejs-website

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Build and deploy a Node.js website/app on the function-compute service (Aliyun FC 3.0 built-in nodejs20 runtime). Teaches the exact index.js handler contract, the real FC 3.0 HTTP request event shape (rawPath, requestContext.http.method, queryParameters, headers, body/isBase64Encoded), zip packaging, and the Main-process-managed create/upload protocol reference. Use this when the user asks to build, host, or deploy a Node.js (JavaScript) site, API, or web app on function-compute, or mentions the "nodejs" environment. 在 function-compute 服务(阿里云 FC 3.0 内置 nodejs20 运行时)上构建并部署 Node.js 网站/应用。讲解 index.js handler 约定、真实的 FC 3.0 HTTP 请求 event 结构(rawPath、 requestContext.http.method、queryParameters、headers、body/isBase64Encoded)、zip 打包方式,以及由 Main 进程受控执行的创建函数 / 上传代码流程参考。当用户需要在 function-compute 上构建、托管或部署 Node.js(JavaScript)站点、接口或 Web 应用,或提到 "nodejs" 环境时使用本指南。

Use cases: documents, frontend, backend, devops

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/fc-nodejs-website

What's inside

Skill name
fc-nodejs-website
Description
Build and deploy a Node.js website/app on the function-compute service (Aliyun FC 3.0 built-in nodejs20 runtime). Teaches the exact index.js handler contract, the real FC 3.0 HTTP request event shape (rawPath, requestContext.http.method, queryParameters, headers, body/isBase64Encoded), zip packaging, and the Main-process-managed create/upload protocol reference. Use this when the user asks to build, host, or deploy a Node.js (JavaScript) site, API, or web app on function-compute, or mentions the "nodejs" environment. 在 function-compute 服务(阿里云 FC 3.0 内置 nodejs20 运行时)上构建并部署 Node.js 网站/应用。讲解 index.js handler 约定、真实的 FC 3.0 HTTP 请求 event 结构(rawPath、 requestContext.http.method、queryParameters、headers、body/isBase64Encoded)、zip 打包方式,以及由 Main 进程受控执行的创建函数 / 上传代码流程参考。当用户需要在 function-compute 上构建、托管或部署 Node.js(JavaScript)站点、接口或 Web 应用,或提到 "nodejs" 环境时使用本指南。
License
MIT
Instructions
311 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (2)

  • .bundled-hash
  • SKILL.md

SKILL.md (first lines)

# Deploy a Node.js Website on Function Compute / 在函数计算上部署 Node.js 网站

## AutoClaw managed-delivery boundary (highest priority) / 受控交付边界(最高优先级)

When `website_delivery_start` or `AUTOCLAW_FUNCTION_COMPUTE_WEBSITE_PROTOCOL`
is active, **do not call `/functionCompute`, read/request/store/output a JWT, or
execute this Skill's curl commands.** API sections are reference-only. Build,
package, and verify the artifact locally; AutoClaw Main owns create/upload, and
the human owns publication. The current managed automatic-preview path supports
nginx only, so do not add an nginx `autoPreview` marker for a Node.js package.

当 `website_delivery_start` 或 `AUTOCLAW_FUNCTION_COMPUTE_WEBSITE_PROTOCOL`
生效时,**禁止调用 `/functionCompute`、读取/索取/保存/输出 JWT,禁止执行本 Skill 的 curl。**
API 章节仅作参考;Agent 只负责本地构建、打包与验证,创建和上传由 AutoClaw Main 负责,
正式发布由用户负责。当前自动预览仅支持 nginx,Node.js 产物不得写 nginx `autoPreview` 标记。

## TL;DR (English)

The `nodejs` environment is the Aliyun FC 3.0 **built-in `nodejs20` runtime**. You write a single `index.js` at the zip root that exports a `handler(event, context, callback)`. FC invokes that handler for every HTTP request and returns whatever you pass to `callback(null, {statusCode, headers, body})`.

Standalone API reference flow (not for AutoClaw-managed delivery):
1. `POST /functionCompute/functions` with `{"environment":"nodejs","name":"..."}` → get the function `id` + `stable_url` + `preview_url`.
2. Zip your `index.js` (at the root), base64-encode it, `POST /functionCompute/functions/{id}/code`. This goes to the **LATEST** version and is immediately live at `preview_url`.
3. **Stop there.** The Agent never publishes. The human clicks **Publish** in the UI to repoint `stable_url` to your new version.

## 一句话总结(中文)

`nodejs` 环境就是阿里云 FC 3.0 的**内置 `nodejs20` 运行时**。你在 zip 根目录写一个 `index.js`,导出 `handler(event, context, callback)`。FC 对每个 HTTP 请求调用该 handler,并返回你传给 `callback(null, {statusCode, headers, body})` 的内容。

独立 API 参考流程(AutoClaw 受控交付中不得执行):
1. `POST /functionCompute/functions`,body 为 `{"environment":"nodejs","name":"..."}` → 得到函数 `id`、`stable_url`、`preview_url`。
2. 把 `index.js`(放在根目录)打成 zip,做 base64 编码,`POST /functionCompute/functions/{id}/code`。代码进入 **LATEST** 版本,立即在 `preview_url` 生效。
3. **到此为止。** Agent 永远不做发布(publish)。由人在 UI 点击 **Publish**,把 `stable_url` 切换到你的新版本。

---

## 1. Environment / 运行环境

**English**

| Property | Value |
|---|---|
| Runtime | `nodejs20` (FC built-in) — Node.js 20.x |
| Handler | `index.handler` (fixed — do not change) |
| Entry file | `index.js` at the **root** of the zip |
| CPU | 0.35 vCPU |
| Memory | 512 MB |
| Disk | 512 MB (writable `/tmp`) |
| Timeout | 60 s per request |
| Instance concurrency | 1 |
| Code location | Extracted to `/code`; `index.js` must be at `/code/index.js` |
| Port | N/A — built-in runtimes use the handler, not a listening port |
| Upload size | Base64 zip ≤ 50 MB decoded |

Constraints to respect: no port/`app.listen()` — the handler IS the server; requests are one-shot (no long-lived connections/WebSockets); each request must finish within 60 s; write only to `/tmp`; keep bundle small (no CDN at build time).

**中文**

| 属性 | 取值 |
|---|---|
| 运行时 | `nodejs20`(FC 内置)— Node.js 20.x |
| Handler | `index.handler`(固定,不要改) |
| 入口文件 | zip **根目录**下的 `index.js` |
| CPU | 0.35 vCPU |
| 内存 | 512 MB |
| 磁盘 | 512 MB(`/tmp` 可写) |
| 超时 | 每个请求 60 秒 |
| 实例并发 | 1 |
| 代码位置 | 解压到 `/code`;即 `/code/index.js` |
| 端口 | 无 — 内置运行时用 handler,而非监听端口 |
| 上传大小 | base64 解码后 zip ≤ 50 MB |

约束:不要监听端口或调用 `app.listen()` —— handler 就是服务器;请求是一次性的(不支持长连接 / WebSocket);每个请求须在 60 秒内完成;只能写 `/tmp`;bundle 尽量小。

---

## 2. Handler contract / Handler 约定

**English** — `index.js` must export `handler` with exactly this signature. Call `callback(null, response)` on success or `callback(err)` on failure. When the function has an HTTP trigger, `event` arrives as **raw bytes** (a `Buffer`) of a JSON document — you MUST `JSON.parse(event.toString())` to read it.

**中文** —— `index.js` 必须导出严格如下签名的 `handler`。成功时调用 `callback(null, response)`,失败时 `callback(err)`。当函数带 HTTP 触发器时,`event` 是一段 JSON 文档的**原始字节**(`Buffer`),你必须用 `JSON.parse(event.toString())` 才能读取。

```js
exports.handler = (event, context, callback) => {
  // event is a Buffer of JSON when the function has an HTTP trigger.
  const req = JSON.parse(event.toString());
  // Correct field access (FC 3.0 HTTP-trigger event, version "v1"):
  //   req.requestContext.http.method  -> HTTP method (GET/POST/...)
  //   req.rawPath                      -> request path (also req.requestContext.http.path)
  //   req.queryParameters              -> query string map
  //   req.headers                      -> request headers map
  //   req.body                         -> request body (base64 when req.isBase64Encoded is true)
  callback(null, {
    statusCode: 200,
    headers: { 'content-type': 'text/html; charset=utf-8' },
    body: '<h1>Hello</h1>',
    // isBase64Encoded: true,  // set when body is base64 (e.g. images)
  });
};
```

### The event shape (verified) / event 结构(已验证)

**English** — The parsed `event` for an FC 3.0 HTTP trigger looks like this. Note there is **no** `httpMethod` and **no** `path` at the top level — use `requestContext.http.method` and `rawPath`.

**中文** —— FC 3.0 HTTP 触发器解析后的 `event` 如下。注意顶层**没有** `httpMethod`、**也没有** `path`——请改用 `requestContext.http.method` 和 `rawPath`。

```json
{
  "version": "v1",
  "rawPath": "/hello/world",
  "headers": { "Accept": "*/*", "User-Agent": "...", "X-Test-Header": "probe123" },
  "queryParameters": { "foo": "bar", "x": "1" },
  "body": "",
  "isBase64Encoded": true,
  "requestContext": {
    "accountId": "...", "domainName": "...", "domainPrefix": "...",
    "requestId": "...", "time": "...", "timeEpoch": "...",
    "http": { "method": "GET", "path": "/hello/world", "protocol": "HTTP/1.1", "sourceIp": "...", "userAgent": "..." }

From Reyvic925/tradingwebsite, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Aug 19, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Reyvic925

Cite this page

fc-nodejs-website skill. Agent Mart. https://agentmart.dev/skills/reyvic925-fc-nodejs-website (last updated 2026-10-24)