-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.ts
45 lines (41 loc) · 1.4 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
import type { AWS } from '@serverless/typescript';
import postRecipes from '@functions/postRecipes';
import updateRecipes from '@functions/updateRecipes';
import getRecipesByID from '@functions/getRecipesByID';
import deleteRecipesByID from '@functions/deleteRecipesByID';
import apiGetByIngredients from '@functions/apiGetByIngredients';
import awsconfig from './config';
const serverlessConfiguration: AWS = {
service: 'reperio-api',
frameworkVersion: '2',
custom: {
webpack: {
webpackConfig: './webpack.config.js',
includeModules: true,
},
},
plugins: ['serverless-webpack', 'serverless-offline'],
provider: {
name: 'aws',
stage: "${opt:stage, 'dev'}",
runtime: 'nodejs14.x',
apiGateway: {
minimumCompressionSize: 1024,
shouldStartNameWithService: true,
},
environment: {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
DB_ENDPOINT: awsconfig['prod'].rds.endpoint,
DB_USERNAME: awsconfig['prod'].rds.username,
DB_PASSWORD: awsconfig['prod'].rds.password,
DB_PORT: awsconfig['prod'].rds.port,
DB_DBNAME: awsconfig['prod'].rds.database,
SPOONACULAR_API_KEY: awsconfig.spoonacular.apiKey,
},
lambdaHashingVersion: '20201221',
},
// import the function via paths
functions: { postRecipes, updateRecipes, getRecipesByID, deleteRecipesByID,
apiGetByIngredients },
};
module.exports = serverlessConfiguration;