Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

219
Vistas
Express (probably) adds http://localhost:3000 before all external links on the page

I have some issue with express in my simply javascript app. I want to make a repository for URLs. On my page I display all links with this code:

const allLinks = links
        .map((link) => {
            const { _id: linkID, name, area, address } = link;
            return `
                <h5>${name}</h5>
                <h5>${area}</h5>
                <div>${address}</div>
                    <!-- edit link -->
                    <a href="edit.html?id=${linkID}" class="">
                        edit
                    </a>
                    <!-- delete btn -->
                    <button type="button" class="delete-btn" data-id="${linkID}">
                        delete
                    </button>
                </div>`;
        })
        .join('');

    linksDOM.innerHTML = allLinks;

Then on my page I see for example link (address) like: www.google.com. I've tried to make a clikable link from it (a tag, on click button), but there's an issue with it. Probably express treats it like link inside app and adds before the link http://localhst:3000, so it goes like http://localhost:3000/www.google.com and of course doesn't work. Same is when I right click and copy link. I just want an external working link, without localhost:3000.

How I can to prevent app/express to do this. Does anyone can help me, please ?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda