Santosh Khavekar Santosh Khavekar - 3 months ago 26
HTTP Question

How to implement Android Deeplink without express server in node.js

I am trying to integrate Android Deeplink with a HTTP server in node.js. Actually, if I create an end point with express server, like

app.get('/deeplink', deeplink({
fallback: '',
android_package_name: ''

it will work fine. But actually I need to integrate with a normal http server.


Yes I have done my job to work it with HTTP end point.No need to require deep-link instead of just modified deep-link library to use with HTTP middle ware. Posting following code ,hope it will help to someone.Thanks

        var file = fs.createReadStream(path.join(__dirname, '/public/index.html'));
        var options={
            fallback: config.deeplink_fallback,
        var detoken = new stream.Transform({ objectMode: true });   
        detoken._transform = function (chunk, encoding, done) {
            var data = chunk.toString()
            Object.keys(options).forEach(function (key) {
                data = data.replace('{{' + key + '}}', options[key])
        var inline = inliner({ basedir: path.join(__dirname, '/public') }); 
        res.setHeader('Content-Type', 'text/html; charset=utf-8');
        var newdt=file.pipe(detoken).pipe(inline);