Picker and middlewares

As we can read in picker package description :

" You can use existing connect and express middlewares without any issues."

But ( tell me if im wrong ) its simply not true because picker uses http.ServerResponse, while express creates wrapper ( https://github.com/expressjs/express/blob/master/lib/response.js ) and most of the express middlewares ( at least middlewares i used) makes use of methods which comes from express implementation. As express do not exposes their wrapper implementation i don’t see at the moment straight way to make sure it work and will work ( for now i could just copy express implementation). I wonder do you have any experience in using express as server router for meteor ? Probably it will need some fiber wrappers but it doesn’t seem to be hard to do.

A lot of the middlewares will work, though you can just use express directly instead of picker to prevent any issues

import { Meteor } from 'meteor/meteor';  
import express from 'express';

const app = express();

app.get('/api', (req, res) => {
    res.status(200).json({ message: 'Hello World!!!'});
});

WebApp.connectHandlers.use(app);
4 Likes