diff --git a/README.md b/README.md index e24c718..f2968a4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # TradeIT! + ## Server less microtrading platform Allow your friends and users to trade with popular items, anytime, @@ -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! diff --git a/sqlBase.js b/sqlBase.js index 025e762..3f894ba 100644 --- a/sqlBase.js +++ b/sqlBase.js @@ -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; } diff --git a/test_events/event_unique.json b/test_events/event_unique.json index cbe0065..efe2612 100644 --- a/test_events/event_unique.json +++ b/test_events/event_unique.json @@ -1,3 +1,3 @@ { - "text" : "sell fb 56" + "text" : "help" } \ No newline at end of file