Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import request from 'request';
- import _ from 'lodash';
- import Boom from 'boom';
- module.exports = function (server) {
- const callWithRequest = server.plugins.elasticsearch.callWithRequest;
- server.route({
- path: '/api/devriskanalysis/treemap/{index}/{type}',
- method: 'POST',
- handler: function (req, reply) {
- const searchParams = {
- index: req.params.index,
- type: req.params.type
- };
- callWithRequest(req, 'search', searchParams)
- .then(
- function (result) {
- reply(result);
- },
- function (error) {
- reply(error);
- });
- }
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement