firstandthird / hapi-agenda

5 stars 3 forks source link

JSON api #6

Closed jgallen23 closed 9 years ago

jgallen23 commented 9 years ago

What about adding an option to expose a json api? should be in this module or separate? @dawnerd ?

dawnerd commented 9 years ago

I don't see why we couldn't expose an api. As long as we have an option for a base path it shouldn't be a problem.

jgallen23 commented 9 years ago

here's what I'm thinking:

GET /job/:id - returns the job
POST /job - creates a new job
DELETE /job/:id - cancel job (does agenda support this?)
GET /job - returns stats for complete, failed, in progress (should this be /stats or /job-stats?)

can you think of any others?

dawnerd commented 9 years ago

Yep, agenda has a cancel.

I think those will work.

jgallen23 commented 9 years ago

maybe /jobs to return stats

dawnerd commented 9 years ago

/jobs sounds good

jgallen23 commented 9 years ago

we should allow passing in the auth scheme as an option