Comments (9)
Hey @samrith-s
@boyney123 left out the --build
flag i mentioned in my PR some time ago - that forces docker compose to rebuild the images and consequently updates the code :)
but hot reloading is also possible by mounting the code from your workstation into the container
looking at the Dockerfile, you should be able to just mount the whole directory into each WORKDIR, so something like this could work... but is untested
version: "3"
services:
mockit-routes:
image: "mockit-routes"
build: "mockit-routes"
ports:
- 3000:3000
volumes:
- .:/usr/src/mockit-routes
mockit-server:
image: "mockit-server"
build: "server"
ports:
- 4000:4000
volumes:
- .:/usr/src/mockit-server
mockit-client:
image: "mockit-client"
build: "client"
ports:
- 5000:3000
environment:
- REACT_APP_MOCKIT_SERVER_URL=http://localhost:3000
- REACT_APP_MOCKIT_API_URL=http://localhost:4000
volumes:
- .:/usr/src/mockit-client
by mounting the whole directory instead of just the routes.json, the used routes json changes from src/config/routes.json to ./configuration/routes.json
ps: feel free to ping me if you have any questions about docker/docker-compose @boyney123, i do have some experience on the topic :)
from mockit.
Hey @boyney123,
Good work with Mockit! I'm keen on contributing regularly and immensely to it and also use it in my workplace.
I can take this up. Seems like a good way to delve into Mockit code and get my hands dirty!
from mockit.
Hey @samrith-s,
Yeah, that sounds great!
Yeah give it a go and see what you can find. Mockit is using react-json-editor-ajrm
for that JSON editor thing, so that might be rendering the HTML, not to sure though.
from mockit.
@boyney123 I had a look at it.
The issue seems to be the package react-json-editor-ajrm
. It does not allow setting HTML values. It throws multiple errors in the console and doesn't save the value either.
I think it'd be ideal to go for something better. Something a la Postman. Probably something like this: http://securingsincity.github.io/react-ace/
from mockit.
@samrith-s yeah sure give it ago see what you can do
I think at some point we should validate the inputs in this form. I'm adding some new inputs as part of #4 , so validation will need to come at some point. Looking at Formik at the moment.
But yeah see what you can do, and get that JSON edited and saved with react-ace
from mockit.
Agreed. But I think we should ask the user to set a response type mandatorily, and strip the validation from the editor. Another function which validates, based on response content type, before saving it to state.
Right now, itβs too coupled with the editor and dependent on the editor itself, which shouldnβt ideally be the case.
from mockit.
Quick question, @boyney123
I have integrated Ace Editor, but I need to save the parser for that route as well. Which validates data. How do I save it to the editRoutes
?
I want to add something like editRoutes.parserType
which will be one of html
, 'markdown
or json
.
from mockit.
@boyney123 Could you maybe help me out here? My React App isn't hot reloading. Keep getting the same error, after running docker-compose up -d
.
from mockit.
Thanks for this @wohlben and helping out. I'm going to raise some docs about how people can contribute and get the whole environment setup as I realise it might be the easiest thing to get up and running (to work on)
from mockit.
Related Issues (20)
- See incoming request log
- Add lint for this project HOT 3
- Featuring mockit in Docusaurus HOT 5
- Use HTTP for git clone instead of SSH HOT 2
- Add random generated data from schema HOT 2
- Add mockit images to Docker registry
- Client tests do not run HOT 2
- export and import feature HOT 7
- Enabling grouped routes causes React errors HOT 2
- better install script HOT 1
- missed dependency HOT 3
- Add .editorconfig file for project HOT 1
- Linting warnings are shown in console HOT 1
- improper headers format in mockit-routes/configuration/routes.json HOT 1
- Please Add POST request which accept request body and then post it.. HOT 1
- Save changes does not do anything HOT 5
- POST doesn't close the connection when 204 response used HOT 6
- SSL & corporate network HOT 1
- Wildcard Path doesn't affected by Delay feature HOT 2
- All Functions not working when hosted on a server HOT 4
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 mockit.