Skip to content
/ Mocca Public

A C# web server for mocking web APIs. One web server records API request and stores the responses in a file. The other web server uses this file to replay responses.

License

Notifications You must be signed in to change notification settings

Beneboe/Mocca

Repository files navigation

Mocca

A C# web server for mocking web APIs. One web server records API request and stores the responses in a file. The other web server uses this file to replay responses.

Configuration

{
    // The Mocca configuration section
    "Mocca": {
        // The URL of the web API that you want to mock.
        "ForwardTo": "https://localhost:7228",
        // The file where you want to store the responses in.
        "ResponseFile": "../responses.txt",
        // The request paths that should not be stored in the file. 
        "IgnoredPaths": [
            "/swagger**"
        ],
        // The JSON properties you want to overwrite.
        "Overwrite": [
            {
                // The method that the request should have.
                "RequestMethod": "GET",
                // The path pattern that the request should match.
                "RequestPathPattern": "/weatherforecast",
                // The JSON property path.
                "PropertyPath": "[4].temperatureC",
                // The replacement value.
                "Value": "69"
            },
            // Add more properties you want to replace.
        ]
    }
}

About

A C# web server for mocking web APIs. One web server records API request and stores the responses in a file. The other web server uses this file to replay responses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages