-
Notifications
You must be signed in to change notification settings - Fork 669
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
Improved development environment #101
Conversation
In development the application can now be run to proxy to the react development server. This resolves the problem where the code needs to be changed in development to point to the server correcly (which is running on a different port). I also modified the csproj file to have msbuild copy the required front-end files to the publish folder when needed. Therefore the built files no longer need to be copied over and permanently stored in the wwwroot because in development the requests are proxied, and in production the files are copied to the publish folder.
Fantastic pull request! I'll play around with this tonight and make sure that everything is in tip-top shape. Thank you @solidsloth! |
I have an email about you commenting on the Good call, I was not aware of the issue with migrations. I added the like because I was not able to run the app from |
Sorry about that, I deleted my comment as I wanted to give this problem some more thought.
I would rather allow users to opt-out of this. What if I deploy two instances of BaGet and both try to run migrations? Maybe a better approach be to add a configuration that runs/disables migrations at start-up, regardless of the build configuration? |
I was thinking the same thing after I commented. Might be good to add some configuration flag that would enable or disable the migrate. Might be best I just revert this portion of the code since it seems irrelevant to this particular PR and I can make a separate request or issue that we can figure something out on. |
@loic-sharma would be nice if you merged this soon, so that I can rebase #103 on top of it and setup running npm in pipeline. |
I tested this on my macbook and ran into some issues. Building a docker image results in the following error:
It looks like this is because the Also, when I run
How did you get around these issues? |
@tomzo Agreed. I'd like to get this merged in ASAP as well :) |
@loic-sharma I don't think I'll have time to look at this tonight. This error looks familiar. I want to say this is actually why I was using Not sure about the docker issue. I was worried the .. path would cause issues in places. I couldn't find a good way to get a better path in msbuild. It would be easier to just move the BaGet.UI folder underneath the BaGet folder, but that would obviously be a pretty massive change to the project structure. Admittedly I haven't looked too much into how the docker image is being built, so I'm not sure if something can be changed there to resolve the issue. |
Also, I think changing |
I have changed pretty much everything about how docker is built in #105 so I don't think it makes sense to make fixes so that this primitive Dockerfile build works here. |
@tomzo I was wondering about this since I knew you were working on something, thanks. |
@solidsloth I have integrated your changes (and intended outcome) into #108, let me know if you are fine with it and can close this. |
@tomzo that's great, thanks. This way we don't have to break docker in the mean time. |
Rebuilds the frontend on the publish step. This is based off @solidsloth's work in #101.
What does this PR do?
In development the application can now be run to proxy to the react development server. This resolves the problem where the code needs to be changed in development to point to the server correcly (which is running on a different port). I also modified the csproj file to have msbuild copy the required front-end files to the publish folder when needed. Therefore the built files no longer need to be copied over and permanently stored in the wwwroot because in development the requests are proxied, and in production the files are copied to the publish folder.
Closes Issue(s)
I think EnsureCreated this might help with issue #96 because the database is now created in development.
Motivation
My main motiviation was to simplify the development and resole the issue about bend URLs being broken in develop mode. This allows the same workflow:
yarn develop
+dotnet run
without needing to change any urls incomponents/SearchResults.tsx
orcomponents/DisplayPackage.tsx
Additional Notes
launch.json
file to work with the new netcoreapp2.1.