higress icon indicating copy to clipboard operation
higress copied to clipboard

[frontend-gray]插件支持在特定Path下返回指定HTML

Open Hazel0928 opened this issue 4 months ago • 2 comments

Why do you need it?

当前mock场景下无法返回HTML格式的文件,返回的格式为text/plain。在某些业务场景下需要在特定path下返回某个页面,因此期望可以支持返回HTML格式的数据

How could it be?

mockHtml:
  - path:
      - "a"
      - "mock"
    html: |-
      <!DOCTYPE html>
      <html lang="zh-CN">
      <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>MFE 微前端应用: App1</title>
      </head>
      <body>
        <div class="container">
          <h1>MFE 微前端应用: App1</h1>
          <script src="./js/a.js"></script>
        </div>
      </body>
      </html>

Other related information

Add any other context or screenshots about the feature request here.

Hazel0928 avatar Sep 27 '24 02:09 Hazel0928