You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

health.js 464B

123456789101112131415161718
  1. const Schmervice = require('@hapipal/schmervice')
  2. module.exports = class HealthService extends Schmervice.Service {
  3. constructor(...args){
  4. super(...args)
  5. }
  6. /**
  7. * Returns date and number of users
  8. * @returns {object}
  9. */
  10. async getStats(){
  11. const { User } = this.server.models()
  12. const users = await User.query()
  13. const date = new Date()
  14. return { date: date.toString(), users: users.length }
  15. }
  16. }