moudy / agenda-ui

A UI to view Agenda jobs
267 stars 24 forks source link

How to run agenda-ui against an express app that uses agenda #19

Open amirmo opened 9 years ago

amirmo commented 9 years ago

I'm confused as how this module is used.

I have an express app and have done the following as per the readme instructs.

var express = require('express');
var Agenda = require('agenda');
var agendaUI = require('agenda-ui');

var app = express();
var agenda = new Agenda(...)

app.use('/agenda-ui', agendaUI(agenda, {poll: 1000}));

then from the root of my express app: ~> cd node_modules/agenda-ui

npm install

but then there was no bower install in the app/ directory. so I couldn't run the bower install

When I go to: localhost//agenda-ui I get 404. I'm not quite sure what's going on.

Could you instruct as how I can run agenda-ui against my express app that uses agenda. ...? thanks

helsont commented 8 years ago

+1

khurrumqureshi commented 8 years ago

Configure agenda-ui on your agenda ready event.

agenda.on('ready', function () {
   // we need to do this to resolve #18 
   agenda._db = agenda._collection;
   app.use('/agenda-ui', agendaUI(agenda, {poll: 60000}));
});
keligijus commented 8 years ago

I think this should be part of documentation as it is not completely obvious how to use the UI now.