Skip to content

not working with express #232

@ph98

Description

@ph98

I tried this code but no luck

const agenda2 = new Agenda({
  db: { address: 'mongodb://root:example@localhost:27017', collection: 'agenda' },
});
router.use("/dash", Agendash(agenda2));


running standalone works like a charm
npx agendash --db=mongodb://root:example@localhost:27017 --port=3002

Error:
TypeError: Cannot read properties of undefined (reading 'collection') at getOverview (/Users/parham/Desktop/apiserver/node_modules/agendash/lib/controllers/agendash.js:126:43) at api (/Users/parham/Desktop/apiserver/node_modules/agendash/lib/controllers/agendash.js:263:7) at /Users/parham/Desktop/apiserver/node_modules/agendash/lib/middlewares/express.js:30:33 at Layer.handle [as handle_request] (/Users/parham/Desktop/apiserver/node_modules/agendash/node_modules/express/lib/router/layer.js:95:5) at next (/Users/parham/Desktop/apiserver/node_modules/agendash/node_modules/express/lib/router/route.js:144:13) at Route.dispatch (/Users/parham/Desktop/apiserver/node_modules/agendash/node_modules/express/lib/router/route.js:114:3) at Layer.handle [as handle_request] (/Users/parham/Desktop/apiserver/node_modules/agendash/node_modules/express/lib/router/layer.js:95:5) at /Users/parham/Desktop/apiserver/node_modules/agendash/node_modules/express/lib/router/index.js:284:15 at Function.process_params (/Users/parham/Desktop/apiserver/node_modules/agendash/node_modules/express/lib/router/index.js:346:12) at next (/Users/parham/Desktop/apiserver/node_modules/agendash/node_modules/express/lib/router/index.js:280:10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions