list.js 361 B

12345678910111213141516171819202122
  1. /**
  2. * @author oldj
  3. * @blog http://oldj.net
  4. */
  5. 'use strict'
  6. const getUserHosts = require('../../actions/getUserHosts')
  7. module.exports = (req, res) => {
  8. getUserHosts()
  9. .then(list => {
  10. let data = {
  11. success: true,
  12. data: list
  13. }
  14. res.end(JSON.stringify(data))
  15. })
  16. .catch(e => {
  17. res.end(e.toString())
  18. })
  19. }