103 lines
3.0 KiB
YAML
103 lines
3.0 KiB
YAML
service: nfa-serverless
|
|
frameworkVersion: '3'
|
|
|
|
plugins:
|
|
- serverless-esbuild
|
|
- serverless-offline
|
|
|
|
provider:
|
|
timeout: 150
|
|
name: aws
|
|
runtime: nodejs18.x
|
|
stage: ${opt:stage, 'prd'}
|
|
region: ${opt:region, 'us-west-2'}
|
|
timeout: 40
|
|
apiGateway:
|
|
minimumCompressionSize: 1024
|
|
shouldStartNameWithService: true
|
|
environment:
|
|
DEBUG: '*'
|
|
AWS_STAGE: ${self:provider.stage}
|
|
AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
|
|
|
|
layers:
|
|
TopicAwsNodeModules:
|
|
path: lambda-layers-node_modules
|
|
TopicAwsLibs:
|
|
path: lambda-layers-libs
|
|
TopicPrismaAwsPrismaClient:
|
|
path: lambda-layers-prisma-client
|
|
|
|
package: {
|
|
patterns: ["dist/**/*.prisma", "**/libquery_engine-rhel-openssl-1.0.x.so.node", "dist/serverless/.env", '!node_modules/**'],
|
|
}
|
|
|
|
custom:
|
|
esbuild:
|
|
bundle: true
|
|
minify: true
|
|
sourcemap: false
|
|
exclude:
|
|
- 'aws-sdk'
|
|
target: 'node18'
|
|
platform: 'node'
|
|
concurrency: 10
|
|
|
|
functions:
|
|
submitAppInfo:
|
|
handler: src/functions/apps/handler.submitAppInfo
|
|
events:
|
|
- http:
|
|
path: app
|
|
method: post
|
|
cors: true
|
|
|
|
submitBuildInfo:
|
|
# Deployment:
|
|
handler: ./dist/serverless/src/functions/builds/handler.submitBuildInfo # TODO This will not work, need to change to nfa-serverless/dist/serverless/src/functions/builds/handler.submitBuildInfo
|
|
# Local development:
|
|
# handler: ./src/functions/builds/handler.submitBuildInfo
|
|
events:
|
|
- http:
|
|
path: build
|
|
method: post
|
|
cors: true
|
|
environment: # TODO They won't be loaded from the shell environment, need to find a way to pass them from the deployment script
|
|
NODE_ENV: production
|
|
# DATABASE_URL: ${env:DATABASE_URL}
|
|
# CONTRACT_ADDRESS: ${env:CONTRACT_ADDRESS}
|
|
# PRIVATE_KEY: ${env:PRIVATE_KEY}
|
|
# JSON_RPC: ${env:JSON_RPC}
|
|
layers:
|
|
- { Ref: TopicAwsNodeModulesLambdaLayer }
|
|
- { Ref: TopicAwsLibsLambdaLayer }
|
|
- { Ref: TopicPrismaAwsPrismaClientLambdaLayer }
|
|
|
|
submitMintInfo:
|
|
# Deployment:
|
|
handler: ./dist/serverless/src/functions/mints/handler.submitMintInfo # TODO This will not work, need to change to nfa-serverless/dist/serverless/src/functions/mints/handler.submitMintInfo
|
|
# Local development:
|
|
# handler: ./src/functions/mints/handler.submitMintInfo
|
|
events:
|
|
- http:
|
|
path: mint
|
|
method: post
|
|
cors: true
|
|
environment: # TODO They won't be loaded from the shell environment, need to find a way to pass them from the deployment script
|
|
NODE_ENV: production
|
|
# DATABASE_URL: ${env:DATABASE_URL}
|
|
# CONTRACT_ADDRESS: ${env:CONTRACT_ADDRESS}
|
|
# PRIVATE_KEY: ${env:PRIVATE_KEY}
|
|
# JSON_RPC: ${env:JSON_RPC}
|
|
layers:
|
|
- { Ref: TopicAwsNodeModulesLambdaLayer }
|
|
- { Ref: TopicAwsLibsLambdaLayer }
|
|
- { Ref: TopicPrismaAwsPrismaClientLambdaLayer }
|
|
|
|
verifyAccessPoint:
|
|
handler: src/functions/apps/handler.verifyApp
|
|
events:
|
|
- http:
|
|
path: verifyApp
|
|
method: post
|
|
cors: true |