microbin icon indicating copy to clipboard operation
microbin copied to clipboard

Add custom URL support

Open OXeu opened this issue 1 year ago • 0 comments

Support https://github.com/szabodanika/microbin/issues/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.

OXeu avatar Feb 24 '24 07:02 OXeu