-
Notifications
You must be signed in to change notification settings - Fork 45
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
Remove '/api' from URLs #7
Comments
That's totally doable, but I'm not sure what the purpose of a separate subdomain is. Why support two different URLs to the same content and try to have people migrate to the new one, when we can simply continue to support the one we already have? |
Because the website and the API are two separate projects, and the discussion in pokeapi#355 seemed to indicate that merging the two projects for deployment added a lot of complexity. Also, keeping them on separate domains allows them to be updated separately. As far as which URL should be canonical, @tdmalone suggested that the proxy might decrease performance slightly, so it might be better to change the canonical URL to Also, if we did change the canonical URL, we wouldn't need to try to have current users migrate over, just new users. From a technical standpoint, supporting both URLs shouldn't be a problem because Netlify can handle the proxy for us. |
I would stay with the classic pattern. pokeapi.co/api/v2 this was the pattern used till now. I don't see any point in changing it. Moreover the migration process could take forever. Let's remember that still a large part of users is using the v1, so they didn't migrate at all. |
@Naramsim Then how do we address the points raised in #355? Namely, keeping the two projects separate (and separately updatable) and being able to merge them together at build time without tons of complexity. Also, there would not be a migration process; both URLs would be supported indefinitely, so we would not need to push users to the new URL. Either way, it doesn't really matter to me, but the more we discuss this, the more I see how supporting two URLs might be unnecessarily redundant, even if it's the simplest solution. |
I'm not seeing how we gain any simplicity by supporting both URLs vs just supporting one. The set of requirements to support "pokeapi.co/api" is a proper subset of the set of requirements to support "api.pokeapi.co" and "pokeapi.co/api" together. I don't see any benefit to the new URL. |
So what do you suggest? |
Well, so if the two endpoints will be supported forever we can just go with the two patterns. If we will switch from static content + Netlify to something else we will have to remember to keep the two endpoints. |
The simple solution: deploy the pokeapi-co repo to one Netlify site. Deploy this repo to another Netlify site. Point the pokeapi.co domain to one site and add a redirect rule from there to the other. If we want to minimize redirects, we can point the domain to the api site and redirect for the non-api pages. Ideally we'd have all our API requests run through a caching and rate limiting proxy anyway (does Cloudflare do that?). |
Sounds like a solution to me. Perhaps by suggesting a change to the canonical URL, I and @tdmalone were trying to fix a potential problem that doesn't actually exist. Anyway, I suppose this issue can be closed (further discussion about the redirect, etc. can happen in pokeapi#355 or in a new issue). It might still be a good idea to remove |
I'd prefer to keep it there since it simplifies converting resource urls to local filesystem paths in Ditto a bit. Also, |
If we plan on hosting the API at api.pokeapi.co (as per pokeapi#355), shouldn't the API URL be like
api.pokeapi.co/v2/ability/1
rather thanapi.pokeapi.co/api/v2/ability/1
? Having theapi
in there twice seems redundant.The text was updated successfully, but these errors were encountered: