-
Notifications
You must be signed in to change notification settings - Fork 33
/
index.ts
76 lines (72 loc) · 3.17 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { DocumentClient } from "aws-sdk/clients/dynamodb";
import { createHandler } from "@webiny/handler-aws";
import graphqlPlugins from "@webiny/handler-graphql";
import i18nPlugins from "@webiny/api-i18n/graphql";
import i18nDynamoDbStorageOperations from "@webiny/api-i18n-ddb";
import adminUsersPlugins from "@webiny/api-security-admin-users";
import securityAdminUsersDynamoDbStorageOperations from "@webiny/api-security-admin-users-so-ddb";
import i18nContentPlugins from "@webiny/api-i18n-content/plugins";
import pageBuilderPlugins from "@webiny/api-page-builder/graphql";
import dbPlugins from "@webiny/handler-db";
import { DynamoDbDriver } from "@webiny/db-dynamodb";
import elasticsearchClientContextPlugin from "@webiny/api-elasticsearch";
import fileManagerPlugins from "@webiny/api-file-manager/plugins";
import fileManagerDynamoDbElasticPlugins from "@webiny/api-file-manager-ddb-es";
import prerenderingServicePlugins from "@webiny/api-prerendering-service/client";
import logsPlugins from "@webiny/handler-logs";
import fileManagerS3 from "@webiny/api-file-manager-s3";
import formBuilderPlugins from "@webiny/api-form-builder/plugins";
import securityPlugins from "./security";
import headlessCmsPlugins from "@webiny/api-headless-cms/plugins";
import headlessCmsDynamoDbElasticStorageOperation from "@webiny/api-headless-cms-ddb-es";
import elasticsearchDataGzipCompression from "@webiny/api-elasticsearch/plugins/GzipCompression";
// Imports plugins created via scaffolding utilities.
import scaffoldsPlugins from "./plugins/scaffolds";
import pagesCustomSearch from "./plugins/pagesCustomSearch";
const debug = process.env.DEBUG === "true";
export const handler = createHandler({
plugins: [
logsPlugins(),
graphqlPlugins({ debug }),
elasticsearchClientContextPlugin({
endpoint: `https://${process.env.ELASTIC_SEARCH_ENDPOINT}`
}),
dbPlugins({
table: process.env.DB_TABLE,
driver: new DynamoDbDriver({
documentClient: new DocumentClient({
convertEmptyValues: true,
region: process.env.AWS_REGION
})
})
}),
securityPlugins(),
i18nPlugins(),
i18nDynamoDbStorageOperations(),
i18nContentPlugins(),
fileManagerPlugins(),
fileManagerDynamoDbElasticPlugins(),
// Add File storage S3 plugin for API file manager.
fileManagerS3(),
prerenderingServicePlugins({
handlers: {
render: process.env.PRERENDERING_RENDER_HANDLER,
flush: process.env.PRERENDERING_FLUSH_HANDLER,
queue: {
add: process.env.PRERENDERING_QUEUE_ADD_HANDLER,
process: process.env.PRERENDERING_QUEUE_PROCESS_HANDLER
}
}
}),
adminUsersPlugins(),
securityAdminUsersDynamoDbStorageOperations(),
pageBuilderPlugins(),
formBuilderPlugins(),
headlessCmsPlugins(),
headlessCmsDynamoDbElasticStorageOperation(),
scaffoldsPlugins(),
elasticsearchDataGzipCompression(),
pagesCustomSearch
],
http: { debug }
});