-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
43 lines (41 loc) · 1 KB
/
nuxt.config.ts
File metadata and controls
43 lines (41 loc) · 1 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
import accepts from 'accepts'
import type { IncomingMessage } from 'http'
export default defineNuxtConfig({
modules: [
'@nuxt/content',
'@nuxtjs/tailwindcss',
'nuxt-proxy',
'./modules/fastapi',
],
proxy: {
options: {
target: 'http://localhost:4000',
changeOrigin: true,
// pathFilter: [
// '/api/hello',
// ]
pathFilter(pathname: string, req: IncomingMessage) {
console.log('Path:', pathname)
console.info('Path filter:', accepts(req).type(['html', 'json']))
return false
/* eslint-disable operator-linebreak */
return accepts(req).type(['html', 'json']) === 'json'
|| req.method !== 'GET'
// || pathname.startsWith('/api')
/* || yourOwnConditionTestFunction() */
}
}
},
fastapi: {
launchServer: true,
},
content: {
highlight: {
theme: 'github-dark-dimmed',
preload: ['python', 'vue', 'vue-html']
}
},
tailwindcss: {
viewer: false
}
})