-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix redirect to accommodate sub-directory deployment #98
Comments
@hangler - Hi Frank - that should resolve the callback url. There is also the 'authority' and 'silent_redirect_uri' the need to be set in the deployment environment. When possible we like to create a deployment artifact that picks up settings in the context of where the app is deployed, eg. web.config with settings for a URI prefix of the app so it knows how to construct URLs when the app is proxied. The dotnet core api has a mechanism for this ie appsettings.<deploy_env>.json. However, for the front end (React, Angular, Vue etc) it looks like the only option is compiling the app with the final deploy settings. This means a build for every deployment environment we have - minimally, DEV, TEST and PROD. not ideal. |
Ah, great, will factor those out as well and update when done. Yes, I don't know of a better solution than building a different artifact for each environment, though maybe there are some floating around out there... But, building each separately is how I've always done it on other projects. At the end of the day, with these front-end apps, it's a problem of getting certain values (e.g. URLs to various APIs) into the client's browser without them hitting a back-end server to retrieve them. The cleanest way is to bake those settings into the JS file they're getting served. |
Discussion here (caveat lector, I have only skimmed it): facebook/create-react-app#2353 |
@hangler I had a read through both facebook/create-react-app#2353 and andrewmclagan/react-env (several times). This looks like a good way to go. I'll be able to run the same 'react-env' as shown here in the TFS deploy which is the logical equivalent of static content deploy or the Docker startup. Since changing homepage in package.json, having the hosting root url in the REACT_APP_* env vars would be preferable from the perspective of the TFS build/deploy. eg. REACT_APP_PUBLIC_URL. Let me know if you have any concerns about this. |
@robinwn I do not in principle, the main question is how to implement it, which I will try to figure out now! |
@hangler the create-react-app example looks like a good starting point |
Well that was easy 😄 I have it working locally. I added a bunch of environment variables to |
@hangler react-env does successive defaulting of various .env, .env.development etc so leaving in say .env.local would be useful for anyone else (say me :-) ) checking out the code. |
@robinwn Definitely! The actual |
Resolved; now working on dev. |
As requested by @robinwn, provide a solution to fixing the callback URL. This will involve an
.env
with a setting.The text was updated successfully, but these errors were encountered: