I have deployed myapp to Google App Engine, with setting
runtime: nodejs
env: flex
My app domain is
but it is auto redirected to
I have also created Google Pub/Sub topic and add subscription, set Push endpoint url to
tested this endpoint_url with postman and it's sure work well, however when I publish message to Pub/Sub but nothing works.
MyApp (Node.js) endpoint handler:
var cors = require('cors');
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(cors());
app.post('/_ah/push-handlers/sample', function (req, res){
console.log('PUBSUB_____',req.body); //this should be printed out
res.status(200).send();
});
//Listener
io.on('connection', function (socket){
// do something
});
var server = http.listen(8080, function(){
console.log('App listening on port %s', server.address().port);
});
This is the logs of GAE, it seems pub/sub does send request to my endpoint but not go to my handler
I appreciate any help :)