Skip to content

How to migrate from an existing express project? #647

Answered by RobinTail
hunght asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @hunght ,

I'd recommend the following migration strategy.

  1. Install express-zod-api and use attachRouting() method with your existing express app as shown in the following example:
    https://github.com/RobinTail/express-zod-api#connect-to-your-own-express-app
  2. Make sure that it still works with an empty routing object, consider replacement of the your 404-handler (if any) to the one returned by attachRouting().
  3. Here begins the iterative process of migrating your endpoints one by one.
    a. Use the documentation and examples to create a copy of one of your endpoint handler using express-zod-api methods, factories, endpoints builders, middlewares and so on.
    b. Remove the pointer of your orig…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@hunght
Comment options

@RobinTail
Comment options

@hunght
Comment options

@elmeister
Comment options

@RobinTail
Comment options

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