Skip to content

Creating API routes and proxying for SSR #12689

Discussion options

You must be logged in to vote

if i understand correctly you need a proxy to redirect to your api.
You can make with http-proxy-middleware

if you use quasar v1
in file src-ssr/index.js

import { createProxyMiddleware } from 'http-proxy-middleware';
...
app.use('/api', createProxyMiddleware({ target: 'http://localhost:8000', changeOrigin: true }))

for quasar v2
src-src/compression.js

import { createProxyMiddleware } from 'http-proxy-middleware';
...
app.use('/api', createProxyMiddleware({ target: 'http://localhost:8000', changeOrigin: true }));

Replies: 1 comment

Comment options

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