Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import request from 'request';
  2. import _ from 'lodash';
  3. import Boom from 'boom';
  4.  
  5. module.exports = function (server) {
  6. const callWithRequest = server.plugins.elasticsearch.callWithRequest;
  7. server.route({
  8. path: '/api/devriskanalysis/treemap/{index}/{type}',
  9. method: 'POST',
  10. handler: function (req, reply) {
  11. const searchParams = {
  12. index: req.params.index,
  13. type: req.params.type
  14. };
  15. callWithRequest(req, 'search', searchParams)
  16. .then(
  17. function (result) {
  18. reply(result);
  19. },
  20. function (error) {
  21. reply(error);
  22. });
  23. }
  24. });
  25.  
  26. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement