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

Add custom URL support #253

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add custom URL support #253

wants to merge 3 commits into from

Conversation

OXeu
Copy link

@OXeu OXeu commented Feb 24, 2024

Support #83

What changed

  • add MICROBIN_ENABLE_CUSTOM_URL argument, default: false
  • replace pasta.id == id to lambda function alias_comparator for better code reuse.
  • add custom_alias field in database

Why replace pasta.id == id

There are a large number of statements in the code that compare pasta.id == id, and implementing custom URL inevitably introduces additional fields, requiring a large number of duplicate judgments to be written at all positions. Therefore, I choose to extract the comparison logic into a lambda function to reduce duplicate code.

Todo

Custom URL validity check.

Support szabodanika#83
- add MICROBIN_ENABLE_CUSTOM_URL argument, default: false
- replace pasta.id == id to lambda function `alias_comparator` for better code reuse.
- add custom_alias field in database
@OXeu OXeu changed the title Add custom url support Add custom URL support Feb 24, 2024
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

Successfully merging this pull request may close these issues.

None yet

1 participant