Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Discussions on This Repo? #496

Open
davidrenne opened this issue Dec 13, 2023 · 0 comments
Open

Enable Discussions on This Repo? #496

davidrenne opened this issue Dec 13, 2023 · 0 comments

Comments

@davidrenne
Copy link

Can you guys enable discussions on this repo so this doesnt have to go into an issue? You can just copy and paste this question into the issues or I will resubmit it if you are okay with enabling the new discussions feature.

I spent about 10-15 minutes just browsing docs, and I wanted to ask a question. All I see in examples and docs are configuration files for setting up the API gateway and static JSON files.

I feel like a really dumb golang engineer here asking this, but, how do you bind a dynamic API endpoint that does something like connect to a database to produce output that the user desires based on their data? Do I merely build my own http listener with standard REST like APIs and then use "targets" and janus will proxy the entire request to the subsequent IP address listening?

Lets say for example someone is requesting something like:

/getUser/6579b440ccc076a4b4685934

I would have an endpoint like:

{
    "name" : "getUser",
    "active" : true,
    "proxy" : {
        "listen_path" : "/getUser/*",
        "upstreams" : {
            "balancing": "roundrobin",
            "targets": [
                {"target": "http://my-ip-address:8080/getUser"}
            ]
        },
        "methods" : ["GET"]
    }
}

And I could somehow pickup userId "6579b440ccc076a4b4685934" in my handler and feed them their user account data?

I basically had never researched API Gateways before and your repo was the first hit. I love the idea of all the grunt work of API architecture done by an open source repo vs. just building it yourself so you can focus on the actual implementation of your custom API rather than all the other issues with scaling, authenticating and rate limiting and other problems this repo seems to solve. There just doesnt seem to be much information on how to wire up real world examples of handlers that are doing anything but feeding static JSON to end users. That doesnt seem very practical. Let me know what I am missing in the docs somewhere where you show a more practical example other than static JSON data

Maybe I missed something in the documentation somewhere where there are examples of real endpoints fetching info from the request and doing backend logic to flush out a response to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant