Closed Dunge closed 2 years ago
Forget this, I believe using a reverse proxy to redirect to the proper application to be a better solution.
Yup this is possible. Here are some examples:
However please note that BaGet's APIs are not stable yet. If you embed BaGet into your app you will need to handle breaking changes.
Thanks. I personally won't use it, as I said before it's ridiculous trying to bundle lots of applications in one big project, I rather use a reverse proxy and keep separate web servers. But I do appreciate you taking the time to reply, and that sample seems quite clear and easy.
I wish to have both a nuget server and my own web application running the same port 80/443.
IIS is usually used to be able to configure multiple applications on the same web server, but in my case my website use a feature (gRPC) IIS does not support in Windows Server 2019, so I have to switch to Kestrel web server instead, which only runs one application at once.
Would it be possible to have BaGet as a service (nuget library) instead of a separate executable so that it could live alongside another application in the same Kestrel server? I'm thinking of a service registered in the ServiceCollection DI container like: