The Legacy Dev Portal Handler helps you maintain compatibility with the legacy developer portal after migrating to the new Zudoku-based developer portal. It supports two modes of operation: redirect mode and proxy mode.
What It Does
When you migrate from the legacy developer portal to the new Zudoku-based
portal, the new portal runs on its own dedicated domain (e.g.,
docs.example.com) instead of under a path on your API domain (e.g.,
api.example.com/docs). The Legacy Dev Portal Handler ensures that users who
navigate to the old /docs path are either redirected to the new domain or can
continue accessing the portal from the same path.
Redirect Mode (Recommended)
In redirect mode, the handler redirects all requests from the legacy path (e.g.,
/docs*) to the new developer portal domain. This is the recommended approach
as it provides better performance and usability.
Setup
- Create a Route: In your
routes.oas.jsonfile (or create a new OpenAPI file likelegacy.oas.json), add a route that matches the legacy path:
Code
Use the path pattern /docs(.*) (not /docs/(.*)) to match both the root path
/docs and all subpaths like /docs/introduction.
Custom Domain
By default, the handler redirects to your project's default Zuplo domain (e.g.,
my-project-1a3ksl3.zuplo.site). If you've set up a custom domain for your
developer portal, the handler will automatically use the custom domain instead.
You must redeploy your API after setting a custom domain in order to pick up the changes.
Learn more about setting up custom domains in the Custom Domains documentation.
Proxy Mode
In proxy mode, the handler proxies requests from the API domain path (e.g.,
/docs*) to the developer portal, allowing the portal to be served from the
same domain as your API. This approach is not recommended for performance and
usability reasons, but is available if you need to keep the developer portal on
the same domain.
Setup
- Configure the Handler: Update your route configuration to use proxy mode:
Code
- Configure Zudoku Base Path: In your
docs/zudoku.config.tsfile, set thebasePathto match the path where your portal will be served:
Code
With this configuration, your developer portal will continue to be accessible at
https://api.example.com/docs just as it was with the legacy developer portal.
Migration Guide
For complete instructions on migrating from the legacy developer portal to Zudoku, see the Dev Portal Migration Guide.