Streamlining ESHOPMAN Admin URL Paths for Standalone Deployments

Optimizing ESHOPMAN Admin URL Structure for Independent Deployments

The ESHOPMAN platform, built on Node.js/TypeScript and designed for headless commerce with deep HubSpot integration, offers immense flexibility, including the ability to deploy its HubSpot Admin Interface as a standalone application. This approach is particularly beneficial for developers who wish to host the storefront management dashboard independently, perhaps on a dedicated subdomain or server, separate from the core ESHOPMAN backend.

However, a common challenge encountered by the ESHOPMAN community revolves around the default URL path when building the Admin Interface for standalone deployment. Often, the built application retains /app in its base URL path, leading to an access URL like youradmin.com/app/ instead of the desired youradmin.com/.

The Challenge: Unwanted /app in Standalone Admin URLs

When the ESHOPMAN Admin Interface is compiled for standalone use (e.g., using a build command like yarn eshopman build --admin-only), the internal router's base path might default to /app. This behavior can be unexpected for developers who intend for their standalone admin application to serve directly from the root of its domain. It can complicate routing, proxy configurations, and overall URL consistency for the HubSpot storefront management experience.

The ESHOPMAN Community Solution: Explicit Path Configuration

Fortunately, the ESHOPMAN community has identified a straightforward and effective solution: explicitly defining the path configuration within the admin section of your ESHOPMAN configuration file. This allows you to override the default behavior and ensure the built Admin Interface uses the desired base URL path.

Here's how you can modify your ESHOPMAN configuration (typically in a file like eshopman-config.ts or similar) to address this:

{
  // ... other ESHOPMAN configurations ...

  admin: {
    // ... other admin specific settings ...
  
    // Explicitly set the base path for the ESHOPMAN Admin HubSpot application.
    // This ensures the built router uses '/' as its base URL, removing the default '/app'.
    path: process.env.ADMIN_PATH as `/${string}` || `/`,
  }
}

In this code snippet, the admin.path property is set. It intelligently uses an environment variable ADMIN_PATH for dynamic configuration, falling back to / if the environment variable is not defined. This configuration instructs the ESHOPMAN build process to establish / as the base path for your standalone Admin application, effectively resolving the issue of the unwanted /app segment.

Why This Matters for ESHOPMAN Developers

Implementing this configuration is a vital best practice for ESHOPMAN developers who are deploying the HubSpot Admin Interface independently. It ensures a clean and predictable URL structure, which is crucial for seamless user experience and robust deployment setups. While this solution is highly effective, the community also advocates for clearer documentation or a default behavior change in future ESHOPMAN versions to make this configuration less of a discovery and more of a standard practice.

By understanding and applying this community insight, ESHOPMAN users can achieve a smoother, more controlled deployment of their storefront management tools, fully leveraging the headless capabilities and HubSpot integration that ESHOPMAN provides.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools