Repository: hashicorp/vault
File: ui/app/router.js (JavaScript)

Code before:
/**
 * Copyright (c) HashiCorp, Inc.
 * SPDX-License-Identifier: BUSL-1.1
 */

import EmberRouter from '@ember/routing/router';
import config from 'vault/config/environment';
import { addDocfyRoutes } from '@docfy/ember';
export default class Router extends EmberRouter {
  location = config.locationType;
  rootURL = config.rootURL;
}

Router.map(function () {
  this.route('vault', { path: '/' }, function () {
    this.route('cluster', { path: '/:cluster_name' }, function () {
      this.route('dashboard');
      this.mount('config-ui');
      this.mount('sync');
      this.route('oidc-provider-ns', { path: '/*namespace/identity/oidc/provider/:provider_name/authorize' });
      this.route('oidc-provider', { path: '/identity/oidc/provider/:provider_name/authorize' });
      this.route('oidc-callback', { path: '/auth/*auth_path/oidc/callback' });
      this.route('auth');
      this.route('redirect');
      this.route('init');
      this.route('logout');
      this.route('license');
      this.route('mfa-setup');
      this.route('clients', function () {
        this.route('counts', function () {
          this.route('overview');
          // TODO remove this conditional when client count feature work for 1.21 is complete
          if (config.environment !== 'production') {
            this.route('client-list');
          }
        });
        this.route('config');
        this.route('edit');
      });
      this.route('usage-reporting');
      this.route('storage', { path: '/storage/raft' });
      this.route('storage-restore', { path: '/storage/raft/restore' });
      this.route('settings', function () {
        this.route('index', { path: '/' });
        this.route('seal');
        this.route('auth', function () {
          this.route('index', { path: '/' });
          this.route('enable');

Review comment (suggestion):
[Optional] - It's 100% superflous, but I think it's nice to explicitly call out the index route in the router. I know it'd be diverent pattern in this file, but it's nice to see that there's _something_ there at the default `/`


```suggestion
          this.route('snapshots', function () {
            this.route('index', { path: '/' });
```

Code after:
/**
 * Copyright (c) HashiCorp, Inc.
 * SPDX-License-Identifier: BUSL-1.1
 */

import EmberRouter from '@ember/routing/router';
import config from 'vault/config/environment';
import { addDocfyRoutes } from '@docfy/ember';
export default class Router extends EmberRouter {
  location = config.locationType;
  rootURL = config.rootURL;
}

Router.map(function () {
  this.route('vault', { path: '/' }, function () {
    this.route('cluster', { path: '/:cluster_name' }, function () {
      this.route('dashboard');
      this.mount('config-ui');
      this.mount('sync');
      // TODO remove conditional once further feature work for single item recovery for release 1.21 is completed
      if (config.environment !== 'production') {
        this.route('recovery', function () {
          this.route('snapshots', function () {
            this.route('load');
            this.route('snapshot', { path: '/:snapshot_id' });
          });
        });
      }
      this.route('oidc-provider-ns', { path: '/*namespace/identity/oidc/provider/:provider_name/authorize' });
      this.route('oidc-provider', { path: '/identity/oidc/provider/:provider_name/authorize' });
      this.route('oidc-callback', { path: '/auth/*auth_path/oidc/callback' });
      this.route('auth');
      this.route('redirect');
      this.route('init');
      this.route('logout');
      this.route('license');
      this.route('mfa-setup');
      this.route('clients', function () {
        this.route('counts', function () {
          this.route('overview');
          // TODO remove this conditional when client count feature work for 1.21 is complete
          if (config.environment !== 'production') {
            this.route('client-list');
          }
        });
        this.route('config');
        this.route('edit');
      });