rss-reader/vue/vite.config.js

55 lines
1.4 KiB
JavaScript

import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
proxy: {
'/login/rss': {
target: 'http://localhost:8001/api/v1/auth/login',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/login\/rss/, ''),
},
'/feeds/get': {
target: 'http://localhost:8001/api/v1/article/get',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/feeds\/get/, ''),
},
'/feeds/sync': {
target: 'http://localhost:8001/api/v1/article/sync',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/feeds\/sync/, ''),
},
'/feeds/read': {
target: 'http://localhost:8001/api/v1/article/read',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/feeds\/read/, ''),
},
'/feeds/add': {
target: 'http://localhost:8001/api/v1/article/add',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/feeds\/add/, ''),
},
},
cors: false
},
})