Skip to content

Commit

Permalink
Merge pull request #23 from do-team/async
Browse files Browse the repository at this point in the history
Added environmental variables for DB connection.
  • Loading branch information
davesade authored Nov 25, 2016
2 parents ebaa859 + 23faf0d commit 5623552
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# TradeIT!

## Server less microtrading platform

Allow your friends and users to trade with popular items, anytime,
Expand All @@ -18,9 +19,18 @@ User can check existing offers in orderbook by typing `sell win` or
There is no intention to have any user management, inventory or account,
all is just harmless fun, almost as a game.

## Technical setup

For deployment, I recommend to use [LambdaDeploy](https://github.com/taylorking/LambdaDeploy) project.

To create Slack integration (API + slash command) I recommend to follow
[this article](https://medium.com/@pixelcodeuk/create-a-slack-slash-command-with-aws-lambda-83fb172f9a74#.rzjjx3g22).

File [database_setup.sql](./MySQLdb/database_setup.sql) contains basic setup of MySQL table,
including products (Warcraft 2 theme). Application currently supports only
BUY and SELL order types.

Environmental variables `TRDIT_DB_URL`, `TRDIT_DB_NAME`, `TRDIT_DB_USER`
and `TRDIT_DB_PASSWORD` are required for proper connection to database.

Have fun!
8 changes: 4 additions & 4 deletions sqlBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ var mysql = require('mysql');
function connectionStart()
{
var connection = mysql.createConnection({
host : 'zu697-microexchange.c4ghekdkimzt.eu-central-1.rds.amazonaws.com',
database : 'microexchange',
user : 'mastertrader',
password : 'micropassword',
host : process.env.TRDIT_DB_URL,
database : process.env.TRDIT_DB_NAME,
user : process.env.TRDIT_DB_USER,
password : process.env.TRDIT_DB_PASSWORD,
});
return connection;
}
Expand Down
2 changes: 1 addition & 1 deletion test_events/event_unique.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"text" : "sell fb 56"
"text" : "help"
}

0 comments on commit 5623552

Please sign in to comment.