Giter Club home page Giter Club logo

mockify's People

Contributors

brianmoran avatar jwanglof avatar p4tin avatar patsevanton avatar pfortin-urbn avatar seriouslysean avatar shivakishore14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mockify's Issues

after export MOCKIFY_ROUTES yamlFile.Get err #open /Users/moranb1/repos/brianmoran/mockify/config/routes.yaml

git clone https://github.com/brianmoran/mockify.git
cd mockify/
go get github.com/gorilla/mux
go get github.com/sirupsen/logrus
go get github.com/json-iterator/go
go get gopkg.in/yaml.v2
go build -o main ./app/cmd/mockify.go
export MOCKIFY_PORT=8001
export MOCKIFY_ROUTES=/home/user/go/src/mockify/config/routes.yaml
./main 
INFO[0000] Looking for routes.yaml file: /Users/moranb1/repos/brianmoran/mockify/config/routes.yaml 
INFO[0000] yamlFile.Get err   #open /Users/moranb1/repos/brianmoran/mockify/config/routes.yaml: no such file or directory  
INFO[0000] map[]                                        
INFO[0000] Ready on port 8001! 

Add multiple responses

Allow for multiple responses. For example, on 1st call to an endpoint provide response[0], the second response[1] etc. and simply starting over at the end of the list to allow for multiple kinds of response (successes and failures).

Add CRUD objects to the routes config file.

in the routes config add something like:

{
   "routes":[
      {
         "path":"/helloworld/{key}",
         "methods":[
            "GET",
            "POST"
         ],
         "responsePath":"app/response/helloworld/helloworld.json"
      }
   ],
   "objects":[
      {
         "wines":[
            {
               "id":1,
               "product":"SOMMELIER SELECT",
               "desc":"Old vine Cabernet Sauvignon",
               "price":159.99
            },
            {
               "id":2,
               "product":"MASTER VINTNER",
               "desc":"Pinot Noir captures luscious aromas",
               "price":89.99
            },
            {
               "id":3,
               "product":"WINEMAKER'S RESERVE",
               "desc":"Merlot featuring complex flavors of cherry",
               "price":84.99
            },
            {
               "id":4,
               "product":"ITALIAN SANGIOVESE",
               "desc":"Sangiovese grape is famous for its dry, bright cherry character",
               "price":147.99
            }
         ],
         "comments":[
            {
               "id":1,
               "body":"like the added grape skins",
               "wineId":1
            },
            {
               "id":1,
               "body":"the directions need to be clearer",
               "wineId":2
            },
            {
               "id":3,
               "body":"I received 3 different packages of wood chips",
               "wineId":1
            }
         ],
         "profile":{
            "name":"vintnor"
         }
      }
   ]
}

Objects would create endpoints for each as:

  • GET /wines
  • GET /wines/1
  • POST /wines Body {json}
  • PUT /wines Body {json}
  • DELETE /wines/5

This give you a full fledged API to start coding frontend apps as well as a powerful capabily to extends and build extra endpoints with the routes

Please make method checking case insensitive

There is a difference in method checking.

Following 2 mockify treat as different:
"method": "GET" and "method": "get"

Or at least adjust example from main README.md, or add a warning about case sensitivity. It is confusing, it make me to lost one hour.

Have multi-arch build in docker hub

Hello, thanks for the small cool project!

Any chances we can have also the ARM version of the image in docker hub?
It's necessary with all the people with M1/M2 chip based Macbooks ๐Ÿ™๐Ÿฝ

As far as my experience goes it's much easier than in the past now with docker to build multi-arch with buildx and push,
or use it through CI, e.g. https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/.

Let me know if I can help, in case.
Thanks again!

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.