/**
 * Created by vishwas3 on 3/8/17.
 */

var express = require('express');
var server = express();
server.use('/', express.static(__dirname + '/build'));
server.listen(8080);
@@ -78,27 +78,1390 @@
 var 
-server = express();
+request = require('request');%0Avar server = express();%0A%0Aserver.get('/api/notify/:fcm', function(req, res)%7B%0A    console.log(%22REQUEST%22,req.params);%0A    var key = 'AAAAaxzCIxA:APA91bEjujdjrAqHhPb9MWtEpaMCKxa0i--K4KPfR5dtXqkhlmbtLOqm705_-NJ6kUOYqRwOBvurJId9yyr2UNkClgltWARrjYlcByXGE5wjaIMdBNZLf8irwiubOej79v461wnHJrM78LoZkRyLW4Wp2cNRYS1Vcg';%0A    var to = req.params.fcm;%0A    to = %22f1WEClQziU4:APA91bENUyx_79nE1c8lEXnHfzu38SlkqIF0c0FrrHw58SR0byKRrf3WNhU_h82QkOMexLKOaJfakGsh7cDViKGD39RpP-1I_TZfsLyANKo1qRp5pT68L8wN-QlxXPnvZFksUh7kqbqY%22;%0A    var notification = %7B%0A        'title': 'Portugal vs. Denmark',%0A        'body': '5 to 1',%0A        'icon': 'firebase-logo.png',%0A        'click_action': 'http://localhost:8080'%0A    %7D;%0A%0A    request(%7B%0A        url: 'https://fcm.googleapis.com/fcm/send',%0A        method: 'POST',%0A        headers:  %7B%0A            'Authorization': 'key=' + key,%0A            'Content-Type': 'application/json'%0A        %7D,%0A        body: JSON.stringify(%7B%0A            'notification': notification,%0A            'to': to%0A        %7D)%0A    %7D, function (error, response, body) %7B%0A        if (error) %7B%0A            console.log(%22Error in post request!%22,error);%0A            res.send('Send notification response: ', error);%0A            res.status(500).send(error);%0A        %7D else %7B%0A            console.log(%22No error, body.%22,body);%0A            res.status(200).send(body);%0A        %7D%0A    %7D);%0A%7D);%0A
 %0Aser
@@ -1512,16 +1512,17 @@
 ild'));%0A
+%0A
 server.l
@@ -1533,8 +1533,9 @@
 n(8080);
+%0A

add fcm notify route