Home » Javascript » Getting subscription object in the server of the push notifications

Getting subscription object in the server of the push notifications

Posted by: admin August 19, 2018 Leave a comment

Questions:

I am working on push notifications and a beginner. In the server part to get the subscription object , what do we pass in ‘/subscribe’ while trying to run it? Client is on localhost:3000 and server on another localhost:5000.

const express = require('express');
const app = express();
app.use(express.static(path.join(__dirname, "client")));
app.use(bodyParser.json);
app.get('/subscribe', (req,res) => {
    //do something
}
Answers: