-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
48 lines (46 loc) · 1.48 KB
/
Copy pathvite.config.ts
File metadata and controls
48 lines (46 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
const NVD_API_KEY = '31fd48e8-7571-4b19-b019-bbcaa683198e'
export default defineConfig({
plugins: [
tailwindcss(),
react(),
],
server: {
proxy: {
'/api/nvd': {
target: 'https://services.nvd.nist.gov',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/nvd/, '/rest/json/cves/2.0'),
headers: {
apiKey: NVD_API_KEY,
},
},
'/api/cisa-kev': {
target: 'https://www.cisa.gov',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/cisa-kev/, '/sites/default/files/feeds/known_exploited_vulnerabilities.json'),
},
'/api/groq': {
target: 'https://api.groq.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/groq/, '/openai/v1'),
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@components': path.resolve(__dirname, './src/components'),
'@features': path.resolve(__dirname, './src/features'),
'@layout': path.resolve(__dirname, './src/layout'),
'@store': path.resolve(__dirname, './src/store'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@lib': path.resolve(__dirname, './src/lib'),
'@types': path.resolve(__dirname, './src/types'),
'@assets': path.resolve(__dirname, './src/assets'),
},
},
})