Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829
  1. const Objection = require('objection')
  2. const Schmervice = require('@hapipal/schmervice')
  3. const ProfileModel = require('../models/profile')
  4. const ResponseModel = require('../models/response')
  5. const ProfileService = require('../services/profile')
  6. const ProfileProfilesRoute = require('../routes/profile/profiles')
  7. module.exports = {
  8. name: 'profile-plugin',
  9. version: '1.0.0',
  10. register: async (server, options) => {
  11. await server.registerModel(ProfileModel)
  12. await server.registerModel(ResponseModel)
  13. // Bind to global context
  14. // So we can use Objection transactions
  15. server.bind({
  16. transaction: fn => Objection.transaction(server.knex(), fn),
  17. })
  18. await server.register(Schmervice)
  19. server.registerService(ProfileService)
  20. await server.route(ProfileProfilesRoute)
  21. },
  22. }