mirror of
https://github.com/ivabus/www
synced 2024-11-22 14:45:05 +03:00
initialize ipfs uploader
This commit is contained in:
parent
79058110bb
commit
dc4b97bbcb
3 changed files with 25 additions and 0 deletions
|
@ -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: {
|
||||
|
|
4
lambdas/src/functions/ipfsUpload/handler.ts
Normal file
4
lambdas/src/functions/ipfsUpload/handler.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
const ipfsUpload = async () => {
|
||||
console.log("uploaded!");
|
||||
}
|
||||
export const main = ipfsUpload;
|
19
lambdas/src/functions/ipfsUpload/index.ts
Normal file
19
lambdas/src/functions/ipfsUpload/index.ts
Normal 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}',
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue