Skip to content

Instantly share code, notes, and snippets.

@andreaseriksson
andreaseriksson / convert_to_verified_routes.ex
Last active March 25, 2025 14:01
This is a mix task for converting old Phoenix routes to new verified routes
defmodule Mix.Tasks.ConvertToVerifiedRoutes do
@shortdoc "Fix routes"
use Mix.Task
@regex ~r/(Routes\.)(.*)_(path|url)\(.*?\)/
@web_module MyAppWeb
def run(_) do
Path.wildcard("lib/**/*.*ex")