Skip to content

Is there a way to change the /api base route? #1482

Answered by crotanite
crotanite asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah at the moment /api is hard-coded, so for anyone who finds this and faces a similar problem: I figured out that the proxy package I was using allows regex and the following fixed this

proxy: {
    '^/api/(?!.*(_content))': {
        target: process.env.API_URL,
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
    },
},

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by crotanite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants