initialize ipfs uploader

This commit is contained in:
neil 2022-10-25 13:09:52 +08:00
parent 79058110bb
commit dc4b97bbcb
3 changed files with 25 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import type { AWS } from '@serverless/typescript';
import buildPackages from '@functions/buildPackages';
import ipfsUpload from '@functions/ipfsUpload';
const serverlessConfiguration: AWS = {
service: 'lambdas',
@ -43,6 +44,7 @@ const serverlessConfiguration: AWS = {
// import the function via paths
functions: {
buildPackages,
ipfsUpload,
},
package: { individually: true },
custom: {

View file

@ -0,0 +1,4 @@
const ipfsUpload = async () => {
console.log("uploaded!");
}
export const main = ipfsUpload;

View file

@ -0,0 +1,19 @@
// import schema from './schema';
import { handlerPath } from '@libs/handler-resolver';
export default {
handler: `${handlerPath(__dirname)}/handler.main`,
events: [
// {
// s3: {
// bucket: '${ssm:AW5_S3_BUCKET}',
// existing: true,
// event: 's3:ObjectCreated:*'
// }
// }
],
environment: {
AWS_DIST_BUCKET: '${ssm:AW5_S3_BUCKET}',
IPFS_IP4_ADDRESS: '${ssm:/ipfs/ip4_address}',
}
};