Skip to content

Instantly share code, notes, and snippets.

import { CSVReaderService } from '../service';
import { ContentResponse } from '../response';
export class CSVReaderController {
private csvReaderService: CSVReaderService;
constructor() {
this.csvReaderService = new CSVReaderService();
}
import { connect } from "../config/db.config";
import { SampleContentModel } from '../model';
export class SampleContentRepository {
constructor() {
connect();
}
public createContent(data: any) {
@bbachi
bbachi / sample-csv.model.ts
Created October 24, 2022 00:25
Blob Trigger
import { model, Schema, Model, Document } from 'mongoose';
export interface ISampleContent extends Document {
firstName: String;
lastName: String;
email: String;
streetNum: String;
streetName: String;
city: String;
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=aautipdf;AccountKey=mhoYa5WaLU9JQNyRxgxC5DGoeuEYhy23Zwz0VOIGdMfvw+CrK1PbGzA1fvseQGuW9YkYGVZ+qEIo+AStwHjCFg==;EndpointSuffix=core.windows.net",
"FUNCTIONS_WORKER_RUNTIME": "node",
"COSMOSDB_HOST": "trigger-mongodb.mongo.cosmos.azure.com",
"COSMOSDB_PORT": "10255",
"COSMOSDB_DBNAME": "Ptrigger-mongodb",
"COSMOSDB_USER": "trigger-mongodb",
"COSMOSDB_PASSWORD": ""
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=aautipdf;AccountKey=mhoYa5WaLU9JQNyRxgxC5DGoeuEYhy23Zwz0VOIGdMfvw+CrK1PbGzA1fvseQGuW9YkYGVZ+qEIo+AStwHjCFg==;EndpointSuffix=core.windows.net",
"FUNCTIONS_WORKER_RUNTIME": "node",
"COSMOSDB_HOST": "trigger-mongodb.mongo.cosmos.azure.com",
"COSMOSDB_PORT": "10255",
"COSMOSDB_DBNAME": "Ptrigger-mongodb",
"COSMOSDB_USER": "trigger-mongodb",
"COSMOSDB_PASSWORD": ""
AWSTemplateFormatVersion: "2010-09-09"
Description: App Runner Template for WebApp
Parameters:
WebAppPort:
Type: Number
Description: The Port that NodeJS API listening on
Default: 80
AllowedValues:
- 80
Outputs:
AppRunnerServiceArn:
Description: ServiceArn of GitHub
Value: !GetAtt WebApp.ServiceArn
AppRunnerServiceId:
Description: AppRunnerServiceId
Value: !GetAtt WebApp.ServiceId
AppRunnerServiceUrl:
Description: AppRunnerServiceUrl
Value: !GetAtt WebApp.ServiceUrl
WebApp:
Type: AWS::AppRunner::Service
Properties:
ServiceName: !Sub WebApp-${Environment}
SourceConfiguration:
AuthenticationConfiguration: !If
- NeedsAccessRole
- AccessRoleArn: !GetAtt AccessRole.Arn
- !Ref AWS::NoValue
AutoDeploymentsEnabled: true
AWSTemplateFormatVersion: "2010-09-09"
Description: App Runner Template for WebApp
Parameters:
WebAppPort:
Type: Number
Description: The Port that NodeJS API listening on
Default: 80
AllowedValues:
- 80
AWSTemplateFormatVersion: "2010-09-09"
Description: ECR Repository For the Docker Image
Resources:
ECRRepo:
Type: AWS::ECR::Repository
Properties:
EncryptionConfiguration:
EncryptionType: AES256
ImageScanningConfiguration: