diff --git a/CHANGELOG b/CHANGELOG index d90eb3c..dfab3ea 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ * Upgrade to Lucky 0.30.1 * Upgrade to Crystal 1.5.0 * Add scrollbar to long code blocks +* Add a downloadable config file for Redirector extension 2022-05-21 diff --git a/src/actions/redirection_config/index.cr b/src/actions/redirection_config/index.cr new file mode 100644 index 0000000..fa7af09 --- /dev/null +++ b/src/actions/redirection_config/index.cr @@ -0,0 +1,55 @@ +class RedirectionConfig::Index < Lucky::Action + include Lucky::ProtectFromForgery + include Lucky::EnforceUnderscoredRoute + include Lucky::SecureHeaders::DisableFLoC + + default_format :json + + get "/redirection_config" do + data( + data: config_json, + content_type: "application/json", + disposition: "attachment", + filename: "redirector-config.json" + ) + end + + private def config_json + <<-JSON + { + "createdBy": "Redirector v3.5.3", + "createdAt": "2022-07-17T00:00:00.000Z", + "redirects": [ + { + "description": "Medium -> Scribe", + "exampleUrl": "https://medium.com/@user/post-123456abcdef", + "exampleResult": "https://#{app_domain}/@user/post-123456abcdef", + "error": null, + "includePattern": "^https?://(?:.*\\.)*(? Scribe" - end - li do - strong "Example URL: " - code "https://medium.com/@user/post-123456abcdef" - end - li do - strong "Include pattern: " - code "^https?://(?:.*\\.)*(?