Refactored backend

This commit is contained in:
Senad Uka
2019-03-25 05:16:58 +01:00
parent 0d7c154958
commit 8c7f26b099
14 changed files with 5 additions and 72 deletions

View File

@@ -1,5 +1,5 @@
const Sequelize = require("sequelize");
const sequelize = require("./db.js");
const sequelize = require("../db/db");
const MarketAlert = sequelize.define("market_alert", {
id: {
type: Sequelize.INTEGER,

View File

@@ -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
View File

@@ -1 +0,0 @@
node_modules/

View File

@@ -1,4 +0,0 @@
# How to deploy automatically:
1. set up aws cli with aws configure

View File

@@ -1 +0,0 @@
{}

View File

@@ -1 +0,0 @@
SECRET_VARIABLE=mysecretval

View File

@@ -1,5 +0,0 @@
{
"key": "value",
"key2": "value2",
"other_key": "other_value"
}

View File

@@ -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"
}]
}
}
}]
}

View File

@@ -1,10 +1,10 @@
let express = require("express");
const path = require("path");
const bodyParser = require("body-parser");
const MarketAlert = require("./backend/MarketAlert");
const sendNotification = require("./backend/utils/sendnotification");
const scrapTheItems = require("./backend/utils/scraptheitems");
const sequelize = require("./backend/db.js");
const MarketAlert = require("./app/models/MarketAlert");
const sendNotification = require("./app/lib/sendnotification");
const scrapTheItems = require("./app/lib/scraptheitems");
const sequelize = require("./app/db/db");
const Twocheckout = require("2checkout-node");
const app = express();