Refactors routers
This commit is contained in:
20
src/Routers/AnalyticsRouter.js
Normal file
20
src/Routers/AnalyticsRouter.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// AnalyticsRouter.js
|
||||
|
||||
var Parse = require('parse/node').Parse;
|
||||
|
||||
import PromiseRouter from '../PromiseRouter';
|
||||
|
||||
// Returns a promise that resolves to an empty object response
|
||||
function ignoreAndSucceed(req) {
|
||||
return Promise.resolve({
|
||||
response: {}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export class AnalyticsRouter extends PromiseRouter {
|
||||
mountRoutes() {
|
||||
this.route('POST','/events/AppOpened', ignoreAndSucceed);
|
||||
this.route('POST','/events/:eventName', ignoreAndSucceed);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user