Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!