Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
austencollins committed Apr 21, 2015
1 parent b297fcb commit 99880fe
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 2,133 deletions.
Empty file modified .jshintrc
100755 → 100644
Empty file.
3 changes: 1 addition & 2 deletions app/controllers/middleware.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Module dependencies.
var
Users = require('../models/users'),
var Users = require('../models/users'),
ServantMetas = require('../models/servant_metas'),
config = require('../../config/config');

Expand Down
13 changes: 13 additions & 0 deletions app/lambda/lambda_one.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* AWS Lambda Task
* - Put tasks in here that take a while to process
* - Then will be uploaded to AWS Lambda and executed there
*/

module.exports = function(a, b, callback) {

var answer = a + b;

return callback(answer);

};
61 changes: 0 additions & 61 deletions app/models/product_link.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/models/servant_metas.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ServantMeta Data Model
*/

var dynamoDB = require('../other/aws_client').dynamoDB,
var dynamoDB = require('../other/aws_services').dynamoDB,
moment = require('moment'),
dynamoDBConverter = require('../other/dynamodb_converter'),
crypto = require('crypto');
Expand Down
2 changes: 1 addition & 1 deletion app/models/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Users Data Model
*/

var dynamoDB = require('../other/aws_client').dynamoDB,
var dynamoDB = require('../other/aws_services').dynamoDB,
dynamoDBConverter = require('../other/dynamodb_converter'),
crypto = require('crypto');

Expand Down
9 changes: 0 additions & 9 deletions app/other/aws_client.js

This file was deleted.

28 changes: 28 additions & 0 deletions app/other/aws_services.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* AWS Services
* - Config the AWS Client and other Ahere
* - Require this into your modules instead of configuring the AWS Client everywhere
*/

var AWS = require('aws-sdk');
var lambdaws = require('lambdaws');

// Config AWS Client
AWS.config.update({
accessKeyId: process.env.AWS_ACCESS_KEY,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
region: "us-east-1"
});

// Config Lambdaws Module
lambdaws.config({
credentials: {
accessKey: process.env.AWS_ACCESS_KEY,
secretKey: process.env.AWS_SECRET_ACCESS_KEY,
},
role: process.env.AWS_LAMBDA_ROLE
});

// Export
module.exports.dynamoDB = new AWS.DynamoDB();
module.exports.lambdaws = lambdaws;
7 changes: 7 additions & 0 deletions app/other/dynamodb_converter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* DynamoDB Converter
* - DynamoDB does not take standard JSON (what the f*ck!)
* - Use these to convert DynamoDB results to standard JSON
*/


var arrayConverter = function(data_in) {
var data_out = [];
if (!data_in)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"express": "^4.12.3",
"forever": "^0.11.1",
"jade": "^1.9.2",
"lambdaws": "^1.0.15",
"lodash": "^2.4.1",
"method-override": "^2.3.2",
"moment": "^2.9.0",
Expand Down
Binary file removed public/fonts/TrendSans-One-webfont.eot
Binary file not shown.
2,059 changes: 0 additions & 2,059 deletions public/fonts/TrendSans-One-webfont.svg

This file was deleted.

Binary file removed public/fonts/TrendSans-One-webfont.ttf
Binary file not shown.
Binary file removed public/fonts/TrendSans-One-webfont.woff
Binary file not shown.
11 changes: 11 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ app.use(robots(__dirname + '/robots.txt'))
// Routes
require('./app/routes')(app); // pass our application into our routes

/**
* Lambda Set-Up
* - Upload all Lambda functions on server start so they are ready to be called
*/
// var lambdaws = require('./app/other/aws_services').lambdaws;

// var lambda_functions_path = __dirname + '/app/lambda';
// fs.readdirSync(lambda_functions_path).forEach(function(file) {
// var func = lambdaws.create(require(lambda_functions_path + '/' + file));
// });

// Start Application
app.listen(port);
console.log('****** Servant Boilerplate ' + env + ' is now running on port ' + port + ' ******'); // shoutout to the user
Expand Down

0 comments on commit 99880fe

Please sign in to comment.