This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: jb-recommendation | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: development | |
region: us-west-2 | |
profile: qa | |
memorySize: 1024 | |
timeout: 900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'reflect-metadata'; | |
export { s3Handler } from './app/controllers/S3Controller'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Callback, Context, Handler, S3Event} from 'aws-lambda'; | |
export const s3Handler: Handler = async (event: S3Event, context: Context, cb: Callback) => { | |
console.log('the event that triggered is ', event); | |
cb(null, {message: 'S3 Handler execution completed'}); | |
} catch (error) { | |
cb(error, {message: 'S3 Handler execution failed'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: jb-recommendation | |
custom: | |
stage: ${opt:stage, 'dev'} | |
configuration: ${file(configurations/${self:custom.stage}.yml)} | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: ${self:custom.stage} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public getName(): string { | |
let result = "NO NAME FOUND"; | |
if(this.name) { | |
result = this.name; | |
} | |
return "NO NAME FOUND"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public getName(): string { | |
let result = "NO NAME FOUND"; | |
if(this.name) { | |
result = this.name; | |
} | |
return result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Track } from "../models/Track"; | |
export class BackgroundImage { | |
dimension: string; | |
url: string; | |
} | |
export class BackgroundImageService { | |
getBackgroundArt(track: Track): BackgroundImage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getBackgroundArt(track: Track): BackgroundImage { | |
switch(track.getGenre()) { | |
case "hiphop": | |
const hipHopImage: BackgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/Qcl98B8Bk3I'}; | |
return hipHopImage; | |
case "jazz": | |
const jazzImage : BackgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/dBWvUqBoOU8'}; | |
return jazzImage; | |
case "rap": | |
const rapImage : BackgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/auq_QbyIA34'}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getBackgroundArt(track: Track): BackgroundImage { | |
let backgroundImage: BackgroundImage; | |
switch(track.getGenre()) { | |
case "hiphop": | |
backgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/Qcl98B8Bk3I'}; | |
break; | |
case "jazz": | |
backgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/dBWvUqBoOU8'}; | |
break; | |
case "rap": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//🚫 | |
getBackgroundArt(track: Track): BackgroundImage { | |
let backgroundImage: BackgroundImage; | |
if(!track.getGenre()) { | |
backgroundImage = {dimension: BackgroundImageDimensions.small, url : this.DEFAULT_BACKGROUND_IMAGE_URL}; | |
} if (track.getGenre() == "hiphop") { | |
backgroundImage = {dimension: BackgroundImageDimensions.small, url: this.HIPHOP_BACKGROUND_IMAGE_URL}; | |
} if(track.getGenre() == "jazz") { | |
backgroundImage = {dimension: BackgroundImageDimensions.small, url: this.JAZZ_BACKGROUND_IMAGE_URL}; | |
} if(track.getGenre() == "rap") { |
OlderNewer