-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.ts
33 lines (31 loc) · 993 Bytes
/
serverless.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
import type { AWS } from '@serverless/typescript'
import { httpEventExpressApp } from './src'
const serverlessConfiguration: AWS = {
service: 'md-sentiment-analyzer',
frameworkVersion: '2',
custom: {
webpack: {
webpackConfig: './webpack.config.js',
includeModules: true
}
},
plugins: ['serverless-webpack', 'serverless-offline'],
provider: {
name: 'aws',
runtime: 'nodejs14.x',
stage: "${opt:stage, 'dev'}", // This is a CLI Param that will be used to differentiate environments
apiGateway: {
minimumCompressionSize: 1024,
shouldStartNameWithService: true,
apiKeys: ['md-sentiment-analyzer-key'] // This key will be auto generated by API gateway
},
environment: {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
NODE_ENV: 'production'
},
lambdaHashingVersion: '20201221'
},
// import the function via paths
functions: { expressApp: httpEventExpressApp }
}
module.exports = serverlessConfiguration