r-nacos Old Console vs New Console: Difference Between /rnacos/ and /rnacos/v2/

The old /rnacos/ endpoint serves the v1 console API with basic CRUD operations, while /rnacos/v2/ provides access to the v2 console API featuring standardized ApiResponse wrappers, extended metrics endpoints, and improved error handling.

r-nacos maintains two distinct console entry points to support both legacy and modern management interfaces. While both endpoints serve identical static UI assets from the embedded web bundle, they communicate with different backend API versions, resulting in significantly different capabilities and response formats.

Static Asset Serving: How Both Consoles Share the Same Frontend

Both console versions serve the identical embedded web bundle from rnacos-web-dist-wrap, but they mount the static assets under different URL prefixes. In src/web_config.rs, the old console routes are registered at lines 166-200:

// src/web_config.rs – old console routes
config
    .service(web::resource("/rnacos").route(web::get().to(index)))
    .service(web::resource("/rnacos/").route(web::get().to(index)))
    .service(web::resource("/rnacos/index.html").route(web::get().to(index)))
    // … additional static routes

The new console routes follow immediately at lines 197-206, mounting the same index handler under the /rnacos/v2/ prefix:

// src/web_config.rs – new console routes
config
    .service(web::resource("/rnacos/v2").route(web::get().to(index)))
    .service(web::resource("/rnacos/v2/").route(web::get().to(index)))
    .service(web::resource("/rnacos/v2/index.html").route(web::get().to(index)))

Because both entry points invoke the same index handler and static file serving logic, the HTML, CSS, and JavaScript resources are identical. The functional divergence occurs at the API layer.

API Architecture: v1 vs v2 Backend Integration

The primary distinction between the two consoles lies in which backend API version they target. The r-nacos codebase maintains separate routing configurations for v1 and v2 console APIs in src/console/api.rs.

Old Console (/rnacos/) and v1 API

The old console communicates with the v1 console API registered under the /nacos/v1/console/* route prefix. In src/web_config.rs lines 152-161, these routes are wired via the console_api_config function:

// src/web_config.rs
.service(
    web::scope("/nacos/v1/console")
        .configure(console::api::console_api_config),
)

The console_api_config function in src/console/api.rs (lines 151-166) registers handlers for namespace management, user authentication, and service configuration using the legacy request/response formats.

New Console (/rnacos/v2/) and v2 API

The new console communicates with the v2 console API registered under /nacos/v2/console/*. This is configured in src/web_config.rs lines 164-176:

// src/web_config.rs
.service(
    web::scope("/nacos/v2/console")
        .configure(console::api::console_api_config_v2),
)

The console_api_config_v2 function in src/console/api.rs (lines 219-236) mounts the enhanced API handlers. Additionally, lines 266-340 register extended endpoints for metrics, MCP (Model Context Protocol) tools, and cluster information that are only available in the v2 API.

Feature Comparison: What the New Console Adds

While both consoles render the same static assets, the v2 API accessed by /rnacos/v2/ provides significant functional improvements defined in src/console/v2/mod.rs.

Standardized Response Model

The v2 API introduces the ApiResponse<T> wrapper (lines 20-38 in src/console/v2/mod.rs), which standardizes JSON responses with consistent error codes and message fields:

// src/console/v2/mod.rs
pub struct ApiResponse<T> {
    pub code: u32,
    pub message: Option<String>,
    pub data: Option<T>,
}

This replaces the ad-hoc response formats used in v1, making client-side error handling more predictable.

Enhanced Error Handling

The v2 module defines specific error code constants (prefixed ERROR_CODE_*) that provide granular failure categorization, compared to the generic error responses in v1.

Additional Management Endpoints

The v2 console API exposes management features not available in v1, including:

  • Metrics endpoints for system monitoring
  • MCP (Model Context Protocol) endpoints for AI tool specification (/nacos/v2/console/mcp/tool and /nacos/v2/console/mcp/spec)
  • Cluster information endpoints for distributed deployment management

These are registered in src/console/api.rs lines 266-340 under the v2 scope.

Migration Path: Choosing Between Old and New

Existing deployments using /rnacos/ continue to function without modification, as the v1 API remains fully supported in src/console/api.rs (lines 151-166). The v1 endpoints provide backward compatibility for legacy integrations and automated scripts.

For new deployments or when accessing advanced features like MCP tools or the unified ApiResponse format, redirect browsers to /rnacos/v2/. The underlying static assets are identical, so no additional bandwidth or storage is required on the server side.

Summary

  • Static Assets: Both /rnacos/ and /rnacos/v2/ serve the same embedded web bundle from rnacos-web-dist-wrap, registered in src/web_config.rs.
  • API Version: The old console calls /nacos/v1/console/* endpoints configured via console_api_config in src/console/api.rs.
  • Enhanced API: The new console calls /nacos/v2/console/* endpoints configured via console_api_config_v2, featuring the ApiResponse<T> wrapper and ERROR_CODE_* constants defined in src/console/v2/mod.rs.
  • Extended Features: Only the v2 console provides metrics, MCP tool/spec, and cluster info endpoints (lines 266-340 in src/console/api.rs).
  • Compatibility: Both consoles run simultaneously; v1 ensures backward compatibility while v2 enables modern management features.

Frequently Asked Questions

Can I run both the old and new consoles simultaneously?

Yes. The r-nacos server registers both route prefixes independently in src/web_config.rs. The old console remains available at /rnacos/ while the new console is accessible at /rnacos/v2/. Both entry points use the same static assets and can be used concurrently without configuration changes.

Do I need to migrate existing scripts from v1 to v2?

No immediate migration is required. The v1 API served by the old console remains fully functional and backward compatible. However, if your scripts require features like the standardized ApiResponse format, MCP tool integration, or cluster metrics, you should update them to call the /nacos/v2/console/* endpoints used by the new console.

What new endpoints are available only in the v2 console?

The v2 console exposes several management endpoints not present in v1, registered in src/console/api.rs lines 266-340. These include metrics collection endpoints for system monitoring, MCP (Model Context Protocol) endpoints for AI tool specification (/nacos/v2/console/mcp/tool and /nacos/v2/console/mcp/spec), and cluster information endpoints for distributed deployment management.

Are the static assets different between the two consoles?

No. Both consoles serve the exact same HTML, CSS, and JavaScript files from the embedded rnacos-web-dist-wrap bundle. The route registration in src/web_config.rs maps both /rnacos/* and /rnacos/v2/* to the same index handler and static file serving logic. The functional difference lies entirely in the backend API version each console calls.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →