LoginSignup
2
2

More than 5 years have passed since last update.

herokuのnode.jsでagendaを使う

Posted at

herokuで起動しているnode.js(hubot)でagendaを使う設定のメモ

heroku

mongodbが必要なのでmongolab(無料枠)をaddonする

heroku addons:create mongolab:sandbox

node script

Agenda = require('agenda')
agenda = new Agenda({db: { address: process.env.MONGOLAB_URI ? 'localhost:27017/agenda'}})

module.exports = (robot) ->
  agenda.define 'agenda:task1', (job, done) ->
    # tasks

  agenda.now('agenda:task1')
  agenda.start()
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2