Skip to content

Commit 7f80d9c

Browse files
authored
Merge pull request #172 from commandeer/dashbird-teh
some dashbird layout
2 parents 4c76fab + 2be4648 commit 7f80d9c

File tree

10 files changed

+3255
-24
lines changed

10 files changed

+3255
-24
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"serverless-offline": "^6.8.0"
4+
}
5+
}

sample-apps/.DS_Store

6 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"id": "0a1670aa-ec49-45ba-9b17-1d135017f9dd",
3+
"name": "Hot Stock Tracker Environment",
4+
"values": [
5+
{
6+
"key": "API_URL",
7+
"value": " https://api.hot-stock-checker.com",
8+
"enabled": true
9+
}
10+
],
11+
"_postman_variable_scope": "environment",
12+
"_postman_exported_at": "2021-02-09T21:06:26.231Z",
13+
"_postman_exported_using": "Postman/7.36.0"
14+
}

sample-apps/robinhood-for-reddit/handlers/hotStock/hotStockHandler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const process: Handler = async (event: any, context: Context) => {
4747
statusCode: 500,
4848
body,
4949
headers: {
50-
"Access-Control-Allow-Origin" : "*", // Required for CORS support to work
5150
"Access-Control-Allow-Credentials" : true, // Required for cookies, authorization headers with HTTPS
5251
"Cache-Control": "no-cache" // No Cache
5352
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './httpResponse';
22
export * from './IHttpResponse';
33
export * from './IStock';
4+
export * from './stock';
45
export * from './StockMarket';
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { IStock } from './IStock';
1+
import { v4 as uuid } from 'uuid';
2+
import { IStock, StockMarket } from './';
23

34
export class Stock implements IStock {
45

@@ -14,21 +15,21 @@ export class Stock implements IStock {
1415
public updatedAt: Date;
1516
public value: number;
1617

17-
constructor(response: IHttpResponse) {
18-
this.id = (response.id)
19-
? response.id
18+
constructor(stock: IStock) {
19+
this.id = (stock.id)
20+
? stock.id
2021
:uuid();
2122

22-
this.bloombergTerminalUrl = response.bloombergTerminalUrl;
23-
this.companyName = response.companyName;
24-
this.companyUrl = response.companyUrl;
25-
this.hasElonMuskTweetedAboutIt = response.hasElonMuskTweetedAboutIt;
26-
this.isHot = response.isHot;
27-
this.marketSymbol = response.marketSymbol;
28-
this.redditMentions = response.redditMentions;
29-
this.stockMarket = response.stockMarket;
30-
this.updatedAt = response.updatedAt;
31-
this.value = response.value;
23+
this.bloombergTerminalUrl = stock.bloombergTerminalUrl;
24+
this.companyName = stock.companyName;
25+
this.companyUrl = stock.companyUrl;
26+
this.hasElonMuskTweetedAboutIt = stock.hasElonMuskTweetedAboutIt;
27+
this.isHot = stock.isHot;
28+
this.marketSymbol = stock.marketSymbol;
29+
this.redditMentions = stock.redditMentions;
30+
this.stockMarket = stock.stockMarket;
31+
this.updatedAt = stock.updatedAt;
32+
this.value = stock.value;
3233
}
3334

3435
}

sample-apps/robinhood-for-reddit/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"test": "mocha -r ts-node/register/transpile-only tests/setup.ts \"tests/handlers/**/*.test.ts\" --timeout 30000 --exit"
55
},
66
"dependencies": {
7-
"@types/uuid": "^8.3.0",
7+
"@types/uuid": "8.3.0",
88
"aws-sdk": "2.556.0",
99
"moment": "2.29.1",
10-
"serverless-localstack": "^0.4.28",
11-
"uuid": "^8.3.2"
10+
"serverless-localstack": "0.4.28",
11+
"uuid": "8.3.2"
1212
},
1313
"devDependencies": {
1414
"@types/aws-lambda": "8.10.24",
@@ -18,6 +18,7 @@
1818
"chai-shallow-deep-equal": "1.4.6",
1919
"lambda-tester": "3.6.0",
2020
"mocha": "5.2.0",
21+
"serverless-offline": "6.8.0",
2122
"serverless-plugin-typescript": "1.1.7",
2223
"ts-node": "8.1.0",
2324
"typescript": "3.6.4"

sample-apps/robinhood-for-reddit/serverless.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ provider:
77
region: us-east-1
88
stage: dev
99
timeout: 30
10-
versionFunctions: false
10+
versionFunctions: true
1111

1212
custom:
1313
localstack:
@@ -17,6 +17,7 @@ custom:
1717
plugins:
1818
- serverless-plugin-typescript
1919
- serverless-localstack
20+
- serverless-offline
2021

2122
functions:
2223
# api gateway

0 commit comments

Comments
 (0)