GithubHelp home page GithubHelp logo

Comments (4)

basdijkstra avatar basdijkstra commented on August 16, 2024 1

You mean you’re using a minimal API rather than the traditional controller-based APIs? I wouldn’t call that new versus old but rather a different design type, but I digress.

I’d like to see if there’s an easy way to do this, too. In my example here: https://github.com/basdijkstra/introduction-to-contract-testing-dotnet/tree/main/AddressProvider I had to wrap my API in a Startup / Program construct to enable adding the Pact service URL and ProviderStateMiddleware in my tests.

If there’s an easier way to do that, I’d love to learn more.

from pact-net.

mefellows avatar mefellows commented on August 16, 2024

I don't know .NET enough to tell you how, but the main thing you need to do is start your service so that it is accessible over an HTTP port (e.g. port 80). If you can do that, then that's all that matters.

That is, how you start your service is irrelevant - Pact just communicates with it over HTTP.

from pact-net.

fingers10 avatar fingers10 commented on August 16, 2024

@basdijkstra I'm using new hosting model which has only Program.cs. And I'm not using minimal api. I'm using normal controllers. A simple .NET 7 API template with normal controller is what I'm using. I googled and found your example repo before raising issue here. I didnt check the contents inside Startup.cs. Now After checking your Startup.cs I'm wondering why this is needed? Can it be added directly in Program.cs?

from pact-net.

adamrodger avatar adamrodger commented on August 16, 2024

This is a duplicate of #444

from pact-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.