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

128
Vistas
Express.js doesn't redirect to custom URL scheme

I'm currently trying to redirect the user to a custom URL scheme with Express.js to open an app installed on my iPad (using "example://").

Here's my code that should redirect to the URL when a button gets pressed on a page running on a different server:

const { response } = require('express');
const express = require('express');
const router = express.Router();
const path = require('path');
const smartMirror = express();


router.get('/', function(req, res){
    res.sendFile(path.join(__dirname + '/test.html'));
});

smartMirror.use('/', router);
smartMirror.listen(process.env.port || 8000);

console.log('Running on Port 8000');

smartMirror.get("/launch", (req, res) => {
    res.redirect(302, "touchpoint://");
    res.status(200);
})

In the console the error says "UnhandledPromiseRejectionWarning: TypeError: node-fetch cannot load [object Request]. URL scheme "touchpoint" is not supported."

What's the problem here?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You've misidentified the problem. It hasn't go anything to do with Express telling the client it has been redirected, it is because you are trying to access the URL with fetch.

Whatever application touchpoint:// has been registered to be handled with, you need to navigate to the URL.

fetch("touchpoint://") won't work (and this is what you are doing, just via a redirect).

This is for much the same reason that <img src="touchpoint://"> wouldn't work if you tried that.

You need to actually navigate to it. e.g.

<a href="touchpoint://"> or location = "touchpoint://".

about 4 years ago · Juan Pablo Isaza Denunciar
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