-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
I have deploy both https://github.com/cheatcode/nodejs-server-boilerplate and https://github.com/cheatcode/nextjs-boilerplate on different servers but I am having problems with the authentication flow. The login method requires setting a cookie for authentication token but when server and client on cross domain, it is not able to set the cookie. Therefore I have put the client files under backend/client and redirected all traffic except api/graphql to client/build/index.html with the following code.
app.use(express.static('client/build'));
app.get('/api/graphql', (req, res) => {
//What to do here to direct traffic to graphql server
});
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname + 'client/build/index.html'));
});
But I couldn't find a way to direct api/graphql to the graphql server.
is there a better approach?
Metadata
Metadata
Assignees
Labels
No labels