-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Feature: Support running WireMock.Net as a sub-app in IIS #158
Comments
You can host WireMock.Net as a web-api, this is described at https://github.com/WireMock-Net/WireMock.Net/wiki/WireMock-as-a-(Azure)-Web-App. Does this help you? |
@StefH Thanks for the pointer! I really appreciate all the samples. I had had some circumstantial issues early on that led me astray, but that sample works for me in IIS once I got my kinks worked out. I still have one related kink: I'm hosting WireMock as a sub app on IIS, but the sub app base directory is still prepending to the request and throwing off the matching. For example, the sub app is in |
Currently it seems that WireMock.Net does not yet support running in a sub-app in IIS. The easiest solution would be that the sub-app folder name would be configured using the FluentMockServerSettings. I'll take a look if I can build that. Edit...
|
Hello @DavidKorn , You can review branch https://github.com/WireMock-Net/WireMock.Net/tree/iis_fix which includes the fix + updated example. And I've created a preview NuGet, please test this and give me feedback. |
Thanks @StefH I'll take a look. Edit: Removed pointless comment. I misunderstood your plan. :) I'll keep reviewing and testing but initially this looks great. |
Nicely done @StefH . It works perfectly in all my local testing. I'll work with my devops in the next few days to get the preview rolled out and I'll report back if there's any surprises. Thanks again for all your work to get make this tool so great. Minor thing: The readme.md in the sample web project references two publish profiles, but those are missing and probably getting git-ignored in your commits. (Even more minor: That csproj includes the wwwroot folder but it doesn't exist from the repo, so that looks a little broken in solution explorer.) |
It looks like the AbsoluteUrl is wrong now. It doesn't include the subpath. |
Hello David, 1] 2] "Path": "/param2",
"AbsolutePath": "/wiremock/param2",
"Url": "http://localhost/param2?key=testdd",
"AbsoluteUrl": "http://localhost/wiremock/param2?key=testdd", I've also added the AbsolutePath, AbsoluteUrl and AbsolutePathSegments to the request, so they can also be used in the handlebars substitution. 3] |
Quick update: We are testing on 1.0.4.5 preview 2, and so far things continue to work well. You mentioned fixing the minor issues, but I don't think the publish profiles referenced in the readme.md are working. For me those get git-ignored, maybe that's why. |
I thought that I did override the ignore... I will take a look, but this will be after some time. No access to code right now. |
@StefH I think you can close this issue whenever you like. The main feature here is working great for us now. |
This weekend I'll see if the ignored files can be added to git. And I will create a official NuGet. |
Is there an easy way to stand up WireMock.Net as a web app hosted on an internal IIS server? Our build & test pipeline pushes web apps to our various test environments, and it would make life a lot easier to deploy WireMock to those test environments in the same way. The goal would be to be able to hit
http://staging.ourCo.com/mock/whatever
and have WireMock generate the response to the/whatever
path.Meanwhile
http://staging.ourCo.com/fancyapp
would be a different site on the same IIS.The text was updated successfully, but these errors were encountered: