16 lines
338 B
JavaScript
16 lines
338 B
JavaScript
const { createProxyMiddleware } = require('http-proxy-middleware')
|
|
|
|
module.exports = (req, res) => {
|
|
let target = ''
|
|
if (req.url.startsWith('/vt')) {
|
|
target = 'https://vitepress-theme-vuetom.vercel.app'
|
|
}
|
|
createProxyMiddleware({
|
|
target,
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/vt/': '/'
|
|
}
|
|
})(req, res)
|
|
}
|