Search code examples
javascriptlocalhostporthref

Route to different port / app


My app is running on https://localhost:1111/App/

On click I want to route to another app / port running on

https://localhost:2222/App/admin

How do I accomplish this?

Attempt:

In my app (which runs on localhost:1111) I added admin to routes:

    routes = [

    {
        name: 'main',
        path: '/',
    },
    {
        name: 'login',
        path: '/login',
    },
    {
        name: 'admin',
        path: '/admin',
        ...
    },
]

However this routes to

https://localhost:1111/App/admin 

Then I tried adding an href to the link

<li><a href="localhost:2222/App/admin" name="Admin"> ADMIN </a></li>

But this linked incorrectly:

https://localhost:1111/App/localhost:2222/App/admin

Thanks


Solution

  • Try this

    <li><a href="https://localhost:2222/App/admin" name="Admin"> ADMIN </a></li>