Skip to content

Commit 93933db

Browse files
authored
feat: swagger (#33)
* feat: import swagger * feat: enable swagger for api page
1 parent 3ab9622 commit 93933db

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

config/config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export default defineConfig({
4949
hash: true,
5050
singular: true,
5151

52+
publicPath: process.env.NODE_ENV === 'development' ? '/' : '/',
53+
5254
fastRefresh: {},
5355
mfsu: {},
5456
esbuild: {},

src/app.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ export const qiankun = async () => {
3636
// .forEach((app) => qiankunApps.push(app));
3737

3838
return {
39-
apps: [],
39+
apps: [
40+
{
41+
name: 'swagger',
42+
entry: 'https://s.implements.io/microapp/pg-swagger/',
43+
},
44+
],
4045
};
4146
} catch (error) {
4247
return {};

src/page/api/index.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import React from 'react';
2+
import { MicroApp } from 'umi';
23

34
const ApiPage: React.FC<Props> = (props) => {
4-
return <div>TODO.</div>;
5+
return (
6+
<MicroApp
7+
name="swagger"
8+
url="https://raw.githubusercontent.com/cnodejs/tegg-cnode/master/docs/swagger.yaml"
9+
/>
10+
);
511
};
612

713
export default ApiPage;

src/page/document.ejs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="apple-mobile-web-app-capable" content="yes" />
7+
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
8+
<meta name="format-detection" content="telephone=no" />
9+
<meta name="format-detection" content="email=no" />
10+
<meta name="viewport"
11+
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
12+
<script>
13+
__webpack_public_path__ = window.resourceBaseUrl || window.publicPath;
14+
</script>
15+
</head>
16+
17+
<body>
18+
<div id="root-master"></div>
19+
</body>
20+
21+
</html>

0 commit comments

Comments
 (0)