Skip to content

Commit

Permalink
feat: swagger (#33)
Browse files Browse the repository at this point in the history
* feat: import swagger

* feat: enable swagger for api page
  • Loading branch information
thonatos authored Jan 24, 2022
1 parent 3ab9622 commit 93933db
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export default defineConfig({
hash: true,
singular: true,

publicPath: process.env.NODE_ENV === 'development' ? '/' : '/',

fastRefresh: {},
mfsu: {},
esbuild: {},
Expand Down
7 changes: 6 additions & 1 deletion src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ export const qiankun = async () => {
// .forEach((app) => qiankunApps.push(app));

return {
apps: [],
apps: [
{
name: 'swagger',
entry: 'https://s.implements.io/microapp/pg-swagger/',
},
],
};
} catch (error) {
return {};
Expand Down
8 changes: 7 additions & 1 deletion src/page/api/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import React from 'react';
import { MicroApp } from 'umi';

const ApiPage: React.FC<Props> = (props) => {
return <div>TODO.</div>;
return (
<MicroApp
name="swagger"
url="https://raw.githubusercontent.com/cnodejs/tegg-cnode/master/docs/swagger.yaml"
/>
);
};

export default ApiPage;
Expand Down
21 changes: 21 additions & 0 deletions src/page/document.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<meta name="format-detection" content="email=no" />
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<script>
__webpack_public_path__ = window.resourceBaseUrl || window.publicPath;
</script>
</head>

<body>
<div id="root-master"></div>
</body>

</html>

0 comments on commit 93933db

Please sign in to comment.