Comments (1)
Hi @bobruub ,
I haven't had a lot of time to look into things (been busy with other projects)... There's been changes to grpc where some of the mock here was probably made obsolete. This is applicable to all custom protocols.
For mountebank-grpc it should go somehting like this (i did this on a win10 host, so adjust accordingly):
Directory Structure
C:\mydir\mountebank-grpc
C:\mydir\mountebank-grpc\mountebank-grpc # cloned repo
C:\mydir\mountebank-grpc\Dockerfile # Dockerfile below
C:\mydir\mountebank-grpc\protocols.json # protocols.json below
Dockerfile
FROM debian:buster
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends ca-certificates dirmngr gnupg wget;\
apt-get install -y --no-install-recommends curl; \
curl -fsSL https://deb.nodesource.com/setup_12.x | bash -; \
apt-get install -y nodejs; \
\
# add whatever you want here
rm -rf /var/lib/apt/lists/*; \
apt-get clean;
COPY . /etc/mountebank
WORKDIR /etc/mountebank
RUN set -ex; \
# install mountebank global
npm install -g mountebank; \
# install mountebank-grpc local
npm install ./mountebank-grpc;
ENTRYPOINT ["mb", "start", "--protofile", "protocols.json"]
protocols.json
{
"grpc": {
"createCommand": "node /etc/mountebank/mountebank-grpc/src/index.js"
}
}
Build the image and run
docker build --tag=mb-grpc:latest
docker run -p 2525:2525 -p 4545:4545 --rm -it mb-grpc
After that I was able to use postman/curl to load the imposter from the README.md
PS C:\mydir\mountebank-grpc> docker run -p 2525:2525 --rm -it mb-grpc
info: [mb:2525] Loaded custom protocol grpc
info: [mb:2525] mountebank v2.4.0 now taking orders - point your browser to http://localhost:2525/ for help
info: [mb:2525] POST /imposters
info: [grpc:4545] Open for business...
info: [grpc:4545] [2021-08-21T21:14:08.925Z] server started on port '4545'
I didn't test the overall grpc functionality since i don't have the tools on this machine.
This should at least get you started. Hope it helps!
from mountebank-grpc.
Related Issues (10)
- Stream close immediately
- Crashes randomly
- "error": "11 OUT_OF_RANGE: invalid message" HOT 1
- Unable to install using npm install after cloning HOT 2
- Unable to match predicate of path and value for grpc request HOT 1
- Docker image for Docker compose HOT 1
- mountebank-grpc:imposter load - failed @ protobufjs/src/root.js HOT 2
- grpc_proxy imposter load failed when different proto files HOT 7
- Streaming responses are not streamed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mountebank-grpc.