-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.ts
More file actions
48 lines (45 loc) · 1.21 KB
/
Copy pathserverless.ts
File metadata and controls
48 lines (45 loc) · 1.21 KB
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
import * as functions from '@functions/index';
import type { AWS } from '@serverless/typescript';
import { includes } from 'lodash';
const isOffline = includes(process.argv, 'offline');
const serverlessConfiguration: AWS = {
service: 'platform-technical-test',
frameworkVersion: '2',
useDotenv: true,
plugins: [
'serverless-pseudo-parameters',
'serverless-webpack',
'serverless-offline'
],
custom: {
webpack: {
webpackConfig: './webpack.config.js',
includeModules: true
}
},
provider: {
name: 'aws',
runtime: 'nodejs14.x',
stage: 'dev',
region: 'ap-southeast-2',
apiGateway: {
minimumCompressionSize: 1024,
shouldStartNameWithService: true
},
environment: {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
API_HOST_URL: isOffline
? 'http://localhost:3000/${self:provider.stage}'
: 'https://#{ApiGatewayRestApi}.execute-api.#{AWS::Region}.amazonaws.com/${self:provider.stage}'
},
lambdaHashingVersion: '20201221'
},
package: {
individually: true,
patterns: ['node_modules/**'],
excludeDevDependencies: true
},
// import the function via paths
functions
};
module.exports = serverlessConfiguration;