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

Enrich proxy URL with more context #7

Open
blenderskool opened this issue Jan 5, 2022 · 5 comments
Open

Enrich proxy URL with more context #7

blenderskool opened this issue Jan 5, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@blenderskool
Copy link
Owner

blenderskool commented Jan 5, 2022

Proxy URLs generated in Diode right now are not human-readable and don't have any context about what the API endpoint actually does.
This can be improved by updating the proxy URL id to include the route name entered by the user.

Example:
{route-name encoded in a URL friendly way}-{nanoid of a shorter length}
In this case, the route name cannot be changed once it's created.

@blenderskool blenderskool added enhancement New feature or request good first issue Good for newcomers labels Jan 5, 2022
@nityam01
Copy link

Hey Akash, I want to try working on this feature
I want a little context here:

  • By route name you mean this id
    Screenshot from 2023-03-21 07-05-10
  • It can be changed to a name entered by the user and once it is entered it can't be changed

@blenderskool
Copy link
Owner Author

Hey @nityam01, answering your questions:

  • The route name is entered by the user while creating an API route. The idea is to transform this route name to a URL safe string and use it in the endpoint URL.

    image

    What you have highlighted is the endpoint URL, after this change it should look something like

    https://diode.vercel.app/api/v1/unsplash-photos-9icUqheIAlSQy
    
  • We will give an option in the future to change the API route name once it's created in the UI, but that won't update the path in the endpoint URL as it would break already existing calls to the API.

Hope that helps!

@nityam01
Copy link

So what I understand by this is that

  • Users can create Routes by providing API route name, Endpoint URL, and selecting a method
  • Once the User clicks on create & configure API route
  • The proxy URL we generate we generate looks like this:
Detail Enter By User: { API route name: "Unsplash Photos", Endpoint URL:'...', method: "GET" }
Proxy URL: https://diode.vercel.app/api/v1/unsplash-photos-9icUqheIAlSQy 
  • We give users an extra feature of changing the API route names once everything is created.

@blenderskool
Copy link
Owner Author

Yes, you got the flow right.

We give users an extra feature of changing the API route names once everything is created.

This is for future and not in scope for this issue right now.

@nityam01
Copy link

Hey, Akash can you assign this issue to me... I will start working on this issue and make a commit once I have done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants