Skip to content

Commit

Permalink
Import full namespace for /common/routes & /server/integrations/handlers
Browse files Browse the repository at this point in the history
Now a diff adding a new route will only include the route definition, and not two additional lines in the import sections.

These modules are pretty small, and we're on the server, so size/tree-shaking isn't a goal.
  • Loading branch information
John Schulz committed Jul 16, 2019
1 parent 1c2d680 commit 7c0a56b
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions x-pack/legacy/plugins/integrations_manager/server/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,33 @@
*/
import { PLUGIN_ID } from '../common/constants';
import { ServerRoute } from '../common/types';
import {
API_LIST_PATTERN,
API_INFO_PATTERN,
API_INSTALL_PATTERN,
API_DELETE_PATTERN,
} from '../common/routes';

import {
handleGetInfo,
handleGetList,
handleRequestDelete,
handleRequestInstall,
} from './integrations';
import * as CommonRoutes from '../common/routes';
import * as Integrations from './integrations/handlers';

// Manager public API paths
export const routes: ServerRoute[] = [
{
method: 'GET',
path: API_LIST_PATTERN,
path: CommonRoutes.API_LIST_PATTERN,
options: { tags: [`access:${PLUGIN_ID}`], json: { space: 2 } },
handler: handleGetList,
handler: Integrations.handleGetList,
},
{
method: 'GET',
path: API_INFO_PATTERN,
path: CommonRoutes.API_INFO_PATTERN,
options: { tags: [`access:${PLUGIN_ID}`], json: { space: 2 } },
handler: handleGetInfo,
handler: Integrations.handleGetInfo,
},
{
method: 'GET',
path: API_INSTALL_PATTERN,
path: CommonRoutes.API_INSTALL_PATTERN,
options: { tags: [`access:${PLUGIN_ID}`], json: { space: 2 } },
handler: handleRequestInstall,
handler: Integrations.handleRequestInstall,
},
{
method: 'GET',
path: API_DELETE_PATTERN,
path: CommonRoutes.API_DELETE_PATTERN,
options: { tags: [`access:${PLUGIN_ID}`], json: { space: 2 } },
handler: handleRequestDelete,
handler: Integrations.handleRequestDelete,
},
];

0 comments on commit 7c0a56b

Please sign in to comment.