Files
kami-parse-server/src/Routers/CloudCodeRouter.js
Florent Vilmart 10ace495d8 Adds jobs endpoint protected by masterKey (#2560)
* Adds jobs endpoint protected by masterKey

* Adds connection timeout for 15 minutes in jobs

* Refactors pushStatusHandler into StatusHandler

* Adds reporting of _JobStatus

* Only accept strings as messages

* Adds test for masterKey basic auth

* Adds CloudCodeRouter for cloud_code endpoint of job status, enable Jobs feature on dashboard

* xit racing test
2016-08-30 07:19:21 -04:00

20 lines
496 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import PromiseRouter from '../PromiseRouter';
const triggers = require('../triggers');
export class CloudCodeRouter extends PromiseRouter {
mountRoutes() {
this.route('GET',`/cloud_code/jobs`, CloudCodeRouter.getJobs);
}
static getJobs(req) {
let config = req.config;
let jobs = triggers.getJobs(config.applicationId) || {};
return Promise.resolve({
response: Object.keys(jobs).map((jobName) => {
return {
jobName,
}
})
});
}
}