mirror of
https://github.com/c8r/x0.git
synced 2024-09-19 17:47:56 +03:00
Add proxy path, default to /api
This commit is contained in:
parent
1f04d5b5f9
commit
93f2f18363
@ -29,6 +29,8 @@ const cli = meow(`
|
||||
|
||||
--proxy Proxy requests to another server (only for dev)
|
||||
|
||||
--proxy-path Path to proxy, default: /api
|
||||
|
||||
`, {
|
||||
alias: {
|
||||
d: 'outDir',
|
||||
|
@ -27,6 +27,7 @@ const start = async (filename, options, config) => {
|
||||
const Component = req.default || req
|
||||
const {
|
||||
proxy,
|
||||
proxyPath = '/api',
|
||||
port = 8000
|
||||
} = options
|
||||
|
||||
@ -51,7 +52,7 @@ const start = async (filename, options, config) => {
|
||||
|
||||
if (proxy) {
|
||||
devOptions.proxy = {
|
||||
'**': proxy
|
||||
[proxyPath]: proxy
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user