Refactored backend
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
const Sequelize = require("sequelize");
|
const Sequelize = require("sequelize");
|
||||||
const sequelize = require("./db.js");
|
const sequelize = require("../db/db");
|
||||||
const MarketAlert = sequelize.define("market_alert", {
|
const MarketAlert = sequelize.define("market_alert", {
|
||||||
id: {
|
id: {
|
||||||
type: Sequelize.INTEGER,
|
type: Sequelize.INTEGER,
|
||||||
19
backend/.env
19
backend/.env
@@ -1,19 +0,0 @@
|
|||||||
AWS_ENVIRONMENT=development
|
|
||||||
AWS_ACCESS_KEY_ID=your_key
|
|
||||||
AWS_SECRET_ACCESS_KEY=your_secret
|
|
||||||
AWS_PROFILE=
|
|
||||||
AWS_SESSION_TOKEN=
|
|
||||||
AWS_ROLE_ARN=your_amazon_role
|
|
||||||
AWS_REGION=us-east-1
|
|
||||||
AWS_FUNCTION_NAME=
|
|
||||||
AWS_HANDLER=index.handler
|
|
||||||
AWS_MEMORY_SIZE=128
|
|
||||||
AWS_TIMEOUT=3
|
|
||||||
AWS_DESCRIPTION=
|
|
||||||
AWS_RUNTIME=nodejs6.10
|
|
||||||
AWS_VPC_SUBNETS=
|
|
||||||
AWS_VPC_SECURITY_GROUPS=
|
|
||||||
AWS_TRACING_CONFIG=
|
|
||||||
AWS_LOGS_RETENTION_IN_DAYS=
|
|
||||||
EXCLUDE_GLOBS="event.json"
|
|
||||||
PACKAGE_DIRECTORY=build
|
|
||||||
1
backend/.gitignore
vendored
1
backend/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# How to deploy automatically:
|
|
||||||
|
|
||||||
1. set up aws cli with aws configure
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
SECRET_VARIABLE=mysecretval
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"key": "value",
|
|
||||||
"key2": "value2",
|
|
||||||
"other_key": "other_value"
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"EventSourceMappings": [
|
|
||||||
{
|
|
||||||
"EventSourceArn": "your event source arn",
|
|
||||||
"StartingPosition": "LATEST",
|
|
||||||
"BatchSize": 100,
|
|
||||||
"Enabled": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"ScheduleEvents": [
|
|
||||||
{
|
|
||||||
"ScheduleName": "node-lambda-test-schedule",
|
|
||||||
"ScheduleState": "ENABLED",
|
|
||||||
"ScheduleExpression": "rate(1 hour)",
|
|
||||||
"Input":
|
|
||||||
{
|
|
||||||
"key1": "value",
|
|
||||||
"key2": "value"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"S3Events": [{
|
|
||||||
"Bucket": "BUCKET_NAME",
|
|
||||||
"Events": [
|
|
||||||
"s3:ObjectCreated:*"
|
|
||||||
],
|
|
||||||
"Filter": {
|
|
||||||
"Key": {
|
|
||||||
"FilterRules": [{
|
|
||||||
"Name": "prefix",
|
|
||||||
"Value": "STRING_VALUE"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
8
index.js
8
index.js
@@ -1,10 +1,10 @@
|
|||||||
let express = require("express");
|
let express = require("express");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const bodyParser = require("body-parser");
|
const bodyParser = require("body-parser");
|
||||||
const MarketAlert = require("./backend/MarketAlert");
|
const MarketAlert = require("./app/models/MarketAlert");
|
||||||
const sendNotification = require("./backend/utils/sendnotification");
|
const sendNotification = require("./app/lib/sendnotification");
|
||||||
const scrapTheItems = require("./backend/utils/scraptheitems");
|
const scrapTheItems = require("./app/lib/scraptheitems");
|
||||||
const sequelize = require("./backend/db.js");
|
const sequelize = require("./app/db/db");
|
||||||
const Twocheckout = require("2checkout-node");
|
const Twocheckout = require("2checkout-node");
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|||||||
Reference in New Issue
Block a user