Giter Site home page Giter Site logo

availity-ekko's People

Contributors

andrewaramsay avatar bobbennett avatar dnoler avatar hoop33 avatar ivern avatar jchristofoli avatar jselden avatar kaseypowers avatar robmcguinness avatar thesharpieone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

availity-ekko's Issues

Allow headers to be set in responses

"v1/route8": {
    "file": "example1.json",
    "get": [
      {
        "file": "example2.json",
        "response": [
          {
            "status": 202,
            "file": "example3.json",
            "headers": {
              "Location": "/v1/route8"
            }
          },
          {
            "status": 201,
            "file": "example4.json"
          }
        ]
      }
    ]
  }

Decoding error with organizations endpoint

When the browser goes to decode the response from the organizations endpoint, there is a decoding error.

image

When trying to view the response in Fiddler, I receive this error:
image

The issue is resolved after I remove the compression middleware.

Middleware configuration doesn't support custom environments

In middleware/index.js:L9-11, the code is pulling in 3 environments (development, testing, and production); however, in server/index.js:L27-28, we pull the environment from the NODE_ENV variable. This variable can be set to anything the developer wants, but setting it to anything other than the 3 environments listed will result in an error:

TypeError: middleware[(environment || "development")] is not a function

The most flexible option would probably be to allow the developer to add their own middleware function for their environment.

Also, I don't believe the availity-toolkit scripts will run for staging and integration since there is no staging or integration middleware setup. I haven't tried though.

Proxy contexts don't trigger

Using the following configuration:

servers: {
  web: {
    host: '0.0.0.0',
    port: 8090
  },
  aries: {
    port: 8280,
    proxy: true,
    proxies: [
      {
        context: "/api",
        rewrite: {
          from: "^/api",
          to: ""
        }
      },
      {
        context: "/public/api",
        rewrite: {
          from: "^/public/api",
          to: ""
        }
      }
    ]
  },
  axi: {
    port: 8080,
    proxy: true,
    proxies: [
      {
        context: "/availity"
      }
    ]
  }
}

}

I can't get the proxy routes to fire. What appears to be happening is that by the time proxy.js gets the request URL to process, req.url already has the context stripped. It's getting /v1/blah instead of /api/v1/blah, which means the matcher never fires.

Add multiple config files support

Currently routes are configured through routes.json file. It is good only for smaller size of apps. In a larger app where different teams develop different APIs, it becomes a pain to maintain this file. Merge conflicts occur very often. And this file gets easily corrupted by a bad merge - it has happened quite some times in our dev env, and when this happens, the app stopped working locally.

@bobbennett can correct me if I am wrong.

If routes can be configured in a dir instead of a single file, we can split up this file into multiple json configs where each team updates their own portion, things would become more manageable.

Options set at the method level are not used

Options set at the method level as seen below are not used. I can only set options such as status and latency at the resource path level.

{
  "resourcePath": {
  "get": [
    {
      "latency": 1000,
      "file": "resource-get.json"
    }
  ],
  "put": [
    {
      "status": 422,
      "latency": 10000,
      "file": "resource-put.json"
    }
  ]
}
}

Promise does not resolve for invalid routes

[15:23:57] [av-ekko] GET /api/v1/organizations/undefined 404 0.496
Warning: a promise was created in a handler but was not returned from it
    at tryOnImmediate (timers.js:534:15)
    at processImmediate [as _immediateCallback] (timers.js:514:5)

Add more params matching support

It would be nice to add more params matching support such as:

  • regex
  • pipe delimited string

For example, if I want to match a param season of Spring|Summer|Fall, currently it seems the only solution is to split them up:

{
    "get": [
        "file": "non-winter-response.json",
        "params": {
            "season": "Spring"
        },
        "file": "non-winter-response.json",
        "params": {
            "season": "Summer"
        },
        "file": "non-winter-response.json",
        "params": {
            "season": "Fall"
        }
    ]
}

It would be nice if we can do:

{
    "get": [
        "file": "non-winter-response.json",
        "params": {
            "season": "Spring|Summer|Fall"
        }
    ]
}

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.