-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:aircodelabs/aircode
- Loading branch information
Showing
11 changed files
with
76 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default [ | ||
{ text: 'Connect Siri to ChatGPT', link: 'https://aircode.cool/hpwdi7n719' }, | ||
{ text: 'Build a Discord ChatGPT Bot', link: 'https://aircode.cool/zsgdima57c' }, | ||
{ text: 'Build a Slack ChatGPT Bot', link: 'https://aircode.cool/vkx3j8c9q5' }, | ||
{ text: 'Build Discord ChatGPT Bot', link: 'https://aircode.cool/zsgdima57c' }, | ||
{ text: 'Build Slack ChatGPT App', link: 'https://aircode.cool/vkx3j8c9q5' }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ESM Support {#intro} | ||
|
||
AirCode supports Node.js's ECMAScript Modules (ESM). You can directly use ESM syntax in files with the `.mjs` extension. | ||
|
||
ESM syntax provides convenience in the following scenarios: | ||
1. Using `import` / `export` statements for importing and exporting modules, providing clearer dependency relationships. | ||
2. More compliant with the ECMAScript specification, consistent with front-end JavaScript modularization, facilitating code sharing between the server and the front end. | ||
3. And more... | ||
|
||
## Create .mjs Files {#create} | ||
|
||
In your project, you can directly create a file with the `.mjs` extension, such as `main.mjs`. In `.mjs` files, you can normally use ESM syntax, and can debug and deploy like files with the `.js` extension. | ||
|
||
For example, create a file named `main.mjs`, the default code is as follows: | ||
|
||
```js | ||
// @see https://docs.aircode.io/guide/functions/ | ||
import aircode from 'aircode'; | ||
|
||
export default async function (params, context) { | ||
console.log('Received params:', params); | ||
return { | ||
message: 'Hi, AirCode.', | ||
}; | ||
}; | ||
``` | ||
|
||
Click **Debug**, and you will see the output `Hi, AirCode` in the **Response** section. | ||
|
||
## More Information {#more} | ||
|
||
For more information about ECMAScript Modules (ESM) and `.mjs` files, please refer to [Node.js Documentation - ECMAScript Modules](https://nodejs.org/api/esm.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ESM 支持 {#intro} | ||
|
||
AirCode 支持 Node.js 的 ECMAScript 模块 (ESM),你可以在 `.mjs` 后缀名的文件中直接使用 ESM 语法。 | ||
|
||
ESM 语法为你在以下场景提供便利: | ||
1. 利用 `import` / `export` 语句对模块进行导入导出,提供更清晰的依赖关系。 | ||
3. 更加符合 ECMAScript 规范,与前端 JavaScript 模块化方式一致,方便进行服务器与前端的代码共享。 | ||
4. 更多…… | ||
|
||
## 创建 .mjs 文件 {#create} | ||
|
||
在你的项目中,你可以直接创建一个 `.mjs` 后缀名的文件,例如 `main.mjs`。在 `.mjs` 文件中,你可以正常使用 ESM 语法,且可像 `.js` 后缀名的文件一样进行调试和部署。 | ||
|
||
例如,创建一个名为 `main.mjs` 的文件,默认的代码如下: | ||
|
||
```js | ||
// @see https://docs.aircode.io/guide/functions/ | ||
import aircode from 'aircode'; | ||
|
||
export default async function (params, context) { | ||
console.log('Received params:', params); | ||
return { | ||
message: 'Hi, AirCode.', | ||
}; | ||
}; | ||
``` | ||
|
||
点击 **Debug**,你就会在 **Response** 栏看到 `Hi AirCode` 的输出。 | ||
|
||
## 更多信息 {#more} | ||
|
||
关于 ECMAScript 模块 (ESM) 和 `.mjs` 文件的更多信息,请参考 [Node.js 文档 - ECMAScript Modules](https://nodejs.org/api/esm.html)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,15 @@ | |
1. 我们的 [GitHub 仓库](https://github.com/aircodelabs/aircode),可以提 issue 或者直接贡献代码 | ||
2. 直接发邮件给我们 [email protected] | ||
3. 我们的 [Discord 讨论区](https://discord.com/invite/XrMVdYdEuY) | ||
4. 我们的[飞书用户群](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=6dem4ab3-d523-4562-9c63-9fb46d565b10),点击链接或扫描下面的二维码加入 | ||
4. 我们的[飞书用户群](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=988pd70a-e66a-49bd-9eac-09acba329491),点击链接或扫描下面的二维码加入 | ||
|
||
<img src="../public/_images/help/feishu.png" width="160px" style="margin-left:30px;"/> | ||
<img src="/_images/help/feishu2.png" width="160px" style="margin-left:30px;"/> | ||
|
||
5. 我们的微信群,微信扫描下面的二维码加入 | ||
|
||
<img src="../public/_images/help/weixin.png" width="160px" style="margin-left:30px;"/> | ||
<img src="/_images/help/weixin.png" width="160px" style="margin-left:30px;"/> | ||
|
||
6. 我们的钉钉群,钉钉扫描下面的二维码加入 | ||
|
||
<img src="../public/_images/help/dingding.png" width="160px" style="margin-left:30px;"/> | ||
<img src="/_images/help/dingding.png" width="160px" style="margin-left:30px;"/> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-51.4 KB
(48%)
docs/zh-cn/src/public/_images/tutorials/weixin-chatgpt/9-weixin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.