question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support external routes in router configuration

See original GitHub issue

I’m submitting a feature request

When building an app that links to external/legacy pages, it would be really handy if the URL’s for those external pages could be configured and generated the same way as the app routes.

Example:

public configureRouter(config: RouterConfiguration, router: AppRouter): void
{
    config.options.pushState = true;
    config.map(
    [
        { route: "/", name: "home", moduleId: "./home", nav: true, title: "Home" },

        // External route
        { route: "http://other-domain.com/:some-parameter", name: "external", title: "External", nav: true }
    ]);
}

The idea is, that routes starting with http:// or https:// would be used as-is, without prepending the base URL of the app. When navigating to the route, the browser location should just be set, instead of replaced, thus navigating out of the app. The route-href attribute would also need to be aware of this, so it sets the correct value for href.

The reason it would be nice to have it as part of the router configuration, is that it would allow us to generate navigation links, and have the external routes mixed in between the app routes. It would also allow us to generate those external URL’s, with parameters, based on the route name, thus keeping the route definitions in one place.

Thoughts?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Alexander-Tarancommented, Mar 15, 2018

I’d love to see how you guys use it. Because from where I’m standing I don’t see the use case for having a route for external link might as well be href="http://domain/path/${param1}/path/${param2}" or <a href="http://aurelia.io/${'docs'}">read me (-:</a> It will also be clearer for those who will read this, that the link is external

Would love to know what am I missing

1reaction
ordinaryorangecommented, Dec 20, 2017

I just tried this in one of the skeletons. I added a route: 'http://www.somedomain.com' and it worked. So I assume it has been patched in ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Inter VLAN Routing with the Use of an External Router
This document describes how to configure the configurations to set up Inter VLAN routing with the use of an external Cisco router.
Read more >
Dynamic Routing Protocol - an overview | ScienceDirect Topics
These dynamic routing protocols are commonly broken into two major categories: Interior routing protocols or IGP (Interior Gateway Protocols) and Exterior ...
Read more >
Chapter 21. Configuring policy-based routing to define ...
You can use policy-based routing to configure a different default gateway for traffic from certain subnets. For example, you can configure RHEL as...
Read more >
Configuring a default static route
You can manually create a default static route that the router uses if there are no other default routes to a destination.
Read more >
Routes - Networking | OpenShift Container Platform 3.11
A router detects relevant changes in the IP addresses of its services and adapts its configuration accordingly. This is useful for custom routers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found