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

static or dynamic router #4125

Open
biancheng347 opened this issue Dec 27, 2024 · 1 comment
Open

static or dynamic router #4125

biancheng347 opened this issue Dec 27, 2024 · 1 comment

Comments

@biancheng347
Copy link

gin dynamic router.POST("api/v1/:type", apiAction)

gin static route
router.POST("api/v1/home", apiHome)
router.POST("api/v1/login", apiLogin)

I used a dynamic route to deal with all the apis, the project is no problem, I want to ask is, dynamic routing in addition to a bit of performance loss, concurrency problems?

@yashisrani
Copy link

@biancheng347 I think dynamic routing is generally safe and does not cause concurrency issues, but it can show slightly performance loss & can increase complexity while dubugging and maintaining handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants