Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app[self.method] is not a function #229

Open
anuxs opened this issue Jan 15, 2018 · 0 comments
Open

app[self.method] is not a function #229

anuxs opened this issue Jan 15, 2018 · 0 comments

Comments

@anuxs
Copy link

anuxs commented Jan 15, 2018

use epilogue in koa,like this :

const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
let app = new Koa();
app.use(bodyParser());
let server = http.createServer(app.callback());
epilogue.initialize({
  app: app,
  sequelize: database
});
let userResource = epilogue.resource({
  model: User,
  endpoints: ['/googles', '/googles/:id']
});

module's version just like this:

  "dependencies": {
    "epilogue": "^0.7.1",
    "koa": "^2.4.1",
    "koa-bodyparser": "^4.2.0",
    "sequelize": "^3.31.1",
  },

error like this

sequelize/node_modules/epilogue/lib/Controllers/base.js:76
  app[self.method](endpoint.string, function(req, res) {
                  ^

TypeError: app[self.method] is not a function
    at Create.Controller.route (/Users/langge/dev/test/h5js/script/sequelize/node_modules/epilogue/lib/Controllers/base.js:76:19)
    at Create.Controller.initialize (/Users/langge/dev/test/h5js/script/sequelize/node_modules/epilogue/lib/Controllers/base.js:33:8)
    at Create.Controller (/Users/langge/dev/test/h5js/script/sequelize/node_modules/epilogue/lib/Controllers/base.js:9:8)
    at new Create (/Users/langge/dev/test/h5js/script/sequelize/node_modules/epilogue/lib/Controllers/create.js:8:17)
    at Resource.<anonymous> (/Users/langge/dev/test/h5js/script/sequelize/node_modules/epilogue/lib/Resource.js:94:32)
    at Array.forEach (<anonymous>)
    at new Resource (/Users/langge/dev/test/h5js/script/sequelize/node_modules/epilogue/lib/Resource.js:90:16)
    at Object.resource (/Users/langge/dev/test/h5js/script/sequelize/node_modules/epilogue/lib/index.js:62:20)
    at Object.<anonymous> (/Users/langge/dev/test/h5js/script/sequelize/koa.js:39:29)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant