Giter Site home page Giter Site logo

Comments (4)

xiaohuoni avatar xiaohuoni commented on April 28, 2024

理论上应该可以通过proxy配置请求。

from dumi.

OxPatient avatar OxPatient commented on April 28, 2024

使用UMI配置可行

from dumi.

amyhuangxbd avatar amyhuangxbd commented on April 28, 2024

使用UMI配置可行

我在.umirc.ts 中配置proxy 还是没有成功
`import { defineConfig } from 'dumi';

const os = require("os");
const ifaces = os.networkInterfaces();

export const getHost = () => {
let host = '127.0.0.1';
let hasFound = false

for (const dev in ifaces) {
ifaces[dev].forEach(function(details) {
if(hasFound) return
if (details.family === 'IPv4' && details.address.indexOf('192.168') >= 0) {
host = details.address;
hasFound=true
}
});
}

return host;
};

export default defineConfig({
title: 'trialos-ui-common',
outputPath: 'docs-dist',
proxy: {
'/api': {
'target': 'http://xxx.test.com',
'changeOrigin': true,
'pathRewrite': { '^/$': '', },
cookieDomainRewrite: getHost(),
},
},
extraBabelPlugins: [
['babel-plugin-import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}],
],
});
`
你是怎么配置的?

from dumi.

tancyan avatar tancyan commented on April 28, 2024

请问这个问题为什么会关闭呀?最终怎么解决么?
proxy仅在dev生效呀,线上部署的doc怎么能用proxy呢?

from dumi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.