1
1
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:
John Otander 2017-10-16 11:04:37 -06:00
parent 1f04d5b5f9
commit 93f2f18363
2 changed files with 4 additions and 1 deletions

View File

@ -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',

View File

@ -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
}
}