Skip to content

Two APIs/routes from one app? #1547

Answered by RobinTail
lpw asked this question in Q&A
Feb 4, 2024 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

Hello, @lpw

I'm trying to serve two related APIs (distinguished by two distinct top-level prefixes in their routes),

Could you please clarify: are those APIs listening to the same port?
What is the nature of those prefixes? Is it a version like v1 and v2?

Can multiple routes (which then requires multiple configs for different tags) be used in one express-zod-api app?

Could you please clarify the differences of those two configs?
Do they only have different tags?

If the only difference is tags, I could suggest to:

  • create const tagsV1 = {}, tagsV2 = {}, tags = {...tagsV1, ...tagsV2};
  • create routingV1, routingV2, routing in a similar way;
  • run a single createServer() with routing and sin…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@lpw
Comment options

@RobinTail
Comment options

Answer selected by RobinTail
Comment options

You must be logged in to vote
2 replies
@RobinTail
Comment options

@RobinTail
Comment options

Comment options

You must be logged in to vote
1 reply
@RobinTail
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants