Skip to content

Commit

Permalink
make sure path is correct to index file
Browse files Browse the repository at this point in the history
  • Loading branch information
bthaile committed Aug 16, 2024
1 parent 34dbbe4 commit 5af55a2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
5 changes: 3 additions & 2 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"version": 2,
"builds": [
{ "src": "api/**/*.js", "use": "@vercel/node" }
{ "src": "api/**/*.js", "use": "@vercel/node" },
{ "src": "dist/**/*", "use": "@vercel/static" }
],
"routes": [
{ "src": "/graphql", "dest": "/api/graphql" },
{ "src": "/[^.]+", "dest": "/", "status": 200 }
{ "src": "/(.*)", "dest": "/index.html" }
]
}
19 changes: 14 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,26 @@ module.exports = {
static: './dist',
allowedHosts: 'all',
historyApiFallback: true,
port: 3000,
port: 3001,
client: {overlay: {warnings: false, errors: false}},
devMiddleware: {
writeToDisk: true,
},
proxy: {
'/graphql': {
target: 'https://api.v1.play.flow.com', // Backend API URL
changeOrigin: true,
pathRewrite: { '^/graphql': '/query' }, // Rewriting `/graphql` to `/query`
logLevel: 'debug', // Add this to see detailed proxy logs in the console
target: 'https://api.v1.play.flow.com',
changeOrigin: true,
pathRewrite: { '^/graphql': '/query' }, // Rewriting the path
logLevel: 'debug',
onProxyRes: function (proxyRes, req, res) {
// Modify the Set-Cookie header if needed, to ensure it's passed back correctly
const cookies = proxyRes.headers['set-cookie'];
if (cookies) {
proxyRes.headers['set-cookie'] = cookies.map(cookie =>
cookie.replace('; Secure', '') // Optionally remove 'Secure' flag for local testing
);
}
},
},
},
},
Expand Down

0 comments on commit 5af55a2

Please sign in to comment.