theming – Render Twig Template instead of standard node fields

Right now my custom module creates a new content type. When an admin creates a node of that content type and save it they see the standard form elements displayed. However the custom module creates a controller/route: path: '/directory/{name}' and if the admin sets a URL alias on the node here is what happens:

  • if directory is prepended in the URL path before the URL alias
  • the controller is called, it finds the node via the alias
  • and makes a couple API calls based on the values in the node
  • And renders out a twig template with all the data is got from the API calls

What I want to happen is have the controller be called whenever a node of that content type is requested and my twig template to be rendered. So if a admin user created this content type and didn’t set and alias, when they save and the browser directs them to /node/123 it will still call my controller and render my twig template. Or if an admin does set a URL alias, it will still call my controller and render my twig template.

Is there a way to complete this is Drupal?