Best practice to use redirect 301

Hi all,

I’m building a new version of an existing web site and I will need to migrate somethings. Some urls will change so I need to create a 301 redirect inside my app. I was taking a look at meteor/force_ssl but it is not yet clear how to do this, because I’m not using the browser url, just the socketjs (server url).

var httpServer = WebApp.httpServer;

httpServer.addListener('request', function (req, res) {
  
});

Doing this on my server is fun, haha. But it is not helping me.

Has anyone tried this before?

Tks

Would this be a good solution?

// Listen to incoming HTTP requests, can only be used on the server
WebApp.connectHandlers.use("/hello", function(req, res, next) {
  res.writeHead(200);
  res.end("Hello world from: " + Meteor.release);
});
2 Likes