-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
44 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
22 changes: 22 additions & 0 deletions
22
packages/document/main-doc/docs/en/components/serve-command.mdx
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,22 @@ | ||
## modern serve | ||
|
||
The `modern serve` command is used to start a Modern.js project in the production environment. It can also be used to preview the artifacts built for the production environment locally. Please note that you need to execute the [`build`](/apis/app/commands#modern-build) command beforehand to generate the corresponding artifacts. | ||
|
||
```bash | ||
Usage: modern serve [options] | ||
|
||
Options: | ||
-c --config <config> specify the configuration file, which can be a relative or absolute path | ||
-h, --help show command help | ||
--api-only only run API service | ||
``` | ||
|
||
By default, the project will run in `localhost:8080`, you can modify the server port number with `server.port`: | ||
|
||
```js | ||
export default defineConfig({ | ||
server: { | ||
port: 8081, | ||
}, | ||
}); | ||
``` |
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
22 changes: 22 additions & 0 deletions
22
packages/document/main-doc/docs/zh/components/serve-command.mdx
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,22 @@ | ||
## modern serve | ||
|
||
`modern serve` 命令用于在生产环境下启动 Modern.js 工程, 也可以用于在本地预览生产环境构建的产物。注意你需要提前执行 [`build`](/apis/app/commands#modern-build) 命令构建出对应产物。 | ||
|
||
```bash | ||
Usage: modern serve [options] | ||
|
||
Options: | ||
-c --config <config> 指定配置文件路径,可以为相对路径或绝对路径 | ||
-h, --help 显示命令帮助 | ||
--api-only 仅启动 API 接口服务 | ||
``` | ||
|
||
默认情况下,应用将会在 `localhost:8080` 启动,可以通过 `server.port` 修改 Server 端口号: | ||
|
||
```js | ||
export default defineConfig({ | ||
server: { | ||
port: 8081, | ||
}, | ||
}); | ||
``` |