Coder Social home page Coder Social logo

Comments (2)

cbrz avatar cbrz commented on June 23, 2024 1

Hi @mukrisp ,

I see the problem. I'll comment on a few things though since it looks like you're trying to get this to work 😄.

  1. You mentioned that you put in a print statement and it caused mountebank to crash. I believe it's by design. From the http protocol it looks like you're supposed to print a JSON object to the console so mountebank knows the service loaded successfully. If you were using console.log(...) to print something before that, I could see a crash happening.

  2. The error you're seeing is due to my bad documentation. If you remove the comment under _note: ... under services, the protocol/service should load. When testing this I sent this body to the imposters endpoint via postman:

{
    "protocol": "grpc",
    "port": 4545,
    "loglevel": "debug",
    "recordRequests": true,
    "services": {
        "example.ExampleService": {
            "file": "example.proto"
        }
    },
    "options": {
        "protobufjs": {
            "_note": "any options to protobufjs",
            "includeDirs": ["/mountebank-grpc/src/protos"]
        }
    },
...
}

That property was accidentally being sent to root.js.

  1. You should be able to send a client request to UnaryUnary after that. If you're using the JSON from the doc, you'll want to remove the stubs.responses[0].is.error since that will override the response in value.

Let me know if you have any other problems. There are some limitations with this implementation with the WellKnownTypes, but if you don't need those these are good for a quick mock.

from mountebank-grpc.

mukrisp avatar mukrisp commented on June 23, 2024

Hi,

Thanks for looking into this. As per your suggestion updated the imposter config by excluding the "_note" param.
It worked. Thanks again.
I am exploring on this. Will post here if any info is needed.

Regards,
Muthukrishnan.P

from mountebank-grpc.

Related Issues (10)

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.