Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit b1c0c93

Browse files
authored
docs: Update advanced.mdx (#71)
1 parent 1ad162b commit b1c0c93

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

pages/docs/advanced.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ pnpm bundle
5757
template={`const { cpus } = require('os')
5858
const { execSync } = require('child_process')
5959
const nodePath = execSync(\`npm root --quiet -g\`, { encoding: 'utf-8' }).split(
60-
'\n',
60+
'\\n',
6161
)[0]
6262
const cpuLen = cpus().length
6363
module.exports = {
6464
apps: [
6565
{
6666
name: 'mx-server',
67-
script: 'out/index.js',
67+
script: './out/index.js',
6868
autorestart: true,
6969
exec_mode: 'cluster',
7070
watch: false,
@@ -79,13 +79,13 @@ module.exports = {
7979
},
8080
},
8181
],
82-
}
82+
}
8383
`}
8484
/>
8585

8686
### 4. 启动
8787

88-
1. 进入 `./apps/core/out`,创建一个 `ecosystem.config.js` 文件
88+
1. 进入 `./apps/core`,修改 `ecosystem.config.js` 文件
8989
2. 将上方复制的内容黏贴进去,然后执行以下命令启动服务
9090

9191
```bash
@@ -125,8 +125,6 @@ setEnvValues(updatedEnvValues);
125125
const handleCopyToClipboard = () => {
126126
copy(updatedEnvTemplate);
127127
};
128-
129-
useEffect(() => {
130128
const updatedTemplate = nowTemplate.replace(
131129
/args:\s*'([^']*)'/,
132130
`args: '${selectedArgs.join(' ')}'`
@@ -139,8 +137,8 @@ const updatedEnvTemplate = updatedTemplate.replace(
139137
.join(', \n ')}
140138
}`
141139
);
142-
setNowTemplate(updatedEnvTemplate);
143-
}, [selectedArgs, envValues]);
140+
141+
useEffect(() => setNowTemplate(updatedEnvTemplate), [selectedArgs, envValues]);
144142

145143
return (
146144

@@ -247,7 +245,7 @@ return (
247245

248246
<button
249247
type="button"
250-
className="border bg-black w-full text-white px-4 py-2 rounded-lg text-sm transform transition-all duration-300 focus:outline-none hover:bg-gray-700 dark:border-gray-700 dark:text-gray-300 "
248+
className="border bg-black w-full px-4 py-2 rounded-lg text-sm transform transition-all duration-300 focus:outline-none hover:text-white hover:bg-gray-700 dark:border-gray-700 dark:text-gray-300 "
251249
onClick={handleCopyToClipboard}
252250
>
253251
复制

0 commit comments

Comments
 (0)