Skip to content

Commit

Permalink
Ajusted production and development configs
Browse files Browse the repository at this point in the history
  • Loading branch information
maiquelcraash committed Mar 13, 2018
1 parent 08cd791 commit 0a95ae8
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 39 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Todos os serviços podem ser localizados e iniciados a partir da pasta *main-ser
- **classifier.js**
- Responsável por treinar os algoritmos e classificar textos requeridos
- Cria um servidor que escutará na porta indicada no arquivo *config/properties.js*
- **server.js**
- Responsável por tratar as requisções provenientes das extenções.
- Cria um servidor que escutará na porta indicada no arquivo *config/properties.js*

### Informações adicionais
- Deve-se iniciar o mongoDB previamente após configurar sua URL e porta no arquivo *config/properties.js*:
Expand Down
94 changes: 56 additions & 38 deletions config/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,59 @@
*/

(function () {
"use strict";

/* Server Settings */
exports.CLASSIFIER_SERVER_PORT = 8082;
exports.CLASSIFIER_HOST = "localhost";
exports.WEB_SERVER_PORT = 8083;
exports.WEB_SERVER_HOST = "localhost";
exports.BODY_LIMIT = "100kb";

/* Twitter Authentication */
exports.TWITTER_KEY = 'BxiQLE4OPPmmRvgw5aC9yKqST';
exports.TWITTER_SECRET = 'LJSKJESeB7NV9SxBbe7QmYVl9bqMpQIIiZKnHDSltQYsUDlliI';
exports.TWITTER_TOKEN = '1539136728-7L8QdVnN0y2BKJ4nJjRtuxwONRBsIHiSXyjHFgM';
exports.TWITTER_TOKEN_SECRET = 'mOauAa9SJEOjmF2JQWiYVqn8ijwMHbsFsEK3kRYRVEJNs';

/* Miner Config */
exports.HANGRY_WORDS = [
'fdp',
'caralho',
'merda',
'bosta',
'porra',
'puta',
'foder'
];

exports.MONGODB_CONFIG = {
"mongoUrl": "mongodb://localhost:27017/KeepCalm",
};

/* Pre-processor Config */
exports.EXCLUDE_RULES = ['PREP', 'CONJCOORD', 'CONJSUB', 'ADV', 'PPS', 'ART', 'PTRA', 'PREP+ART', 'PPOA', 'PPOA', 'PR'];
exports.TRASH_WORDS = ['d', 'q', 'p', 'jah', 'tbm', 'soh', 'msm', 'qm', 'vc'];
exports.TRASH_SYMBOLS = ['@', 'kk', 'hehe', 'shua', 'ahh', 'ahua', 'http', 'haha', '#', 'R$', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];

/* Classifier Config */
exports.EFFECTIVE_PERCENTUAL = 75;
}());
"use strict";

/* Server Settings */
exports.BODY_LIMIT = "100kb";

if (process.env.NODE_ENV === "development") {
exports.CLASSIFIER_SERVER_PORT = 8082;
exports.CLASSIFIER_HOST = "localhost";
exports.WEB_SERVER_PORT = 8083;
exports.WEB_SERVER_HOST = "localhost";

exports.MONGODB_CONFIG = {
"mongoUrl": "mongodb://localhost:27017/KeepCalm",
};
}

else if (process.env.NODE_ENV === "production") {
exports.CLASSIFIER_SERVER_PORT = 11107;
exports.CLASSIFIER_HOST = "node161773-env-0316101.jelasticlw.com.br";
exports.WEB_SERVER_PORT = 11129;
exports.WEB_SERVER_HOST = "node161774-env-4978347.jelasticlw.com.br";

exports.MONGODB_CONFIG = {
"mongoUrl": "mongodb://node161772-env-0316101.jelasticlw.com.br:11125/KeepCalm",
};

}

/* Twitter Authentication */
exports.TWITTER_KEY = 'BxiQLE4OPPmmRvgw5aC9yKqST';
exports.TWITTER_SECRET = 'LJSKJESeB7NV9SxBbe7QmYVl9bqMpQIIiZKnHDSltQYsUDlliI';
exports.TWITTER_TOKEN = '1539136728-7L8QdVnN0y2BKJ4nJjRtuxwONRBsIHiSXyjHFgM';
exports.TWITTER_TOKEN_SECRET = 'mOauAa9SJEOjmF2JQWiYVqn8ijwMHbsFsEK3kRYRVEJNs';

/* Miner Config */
exports.HANGRY_WORDS = [
'fdp',
'caralho',
'merda',
'bosta',
'porra',
'puta',
'foder'
];


/* Pre-processor Config */
exports.EXCLUDE_RULES = ['PREP', 'CONJCOORD', 'CONJSUB', 'ADV', 'PPS', 'ART', 'PTRA', 'PREP+ART', 'PPOA', 'PPOA', 'PR'];
exports.TRASH_WORDS = ['d', 'q', 'p', 'jah', 'tbm', 'soh', 'msm', 'qm', 'vc'];
exports.TRASH_SYMBOLS = ['@', 'kk', 'hehe', 'shua', 'ahh', 'ahua', 'http', 'haha', '#', 'R$', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];

/* Classifier Config */
exports.EFFECTIVE_PERCENTUAL = 75;
}
()
);
2 changes: 1 addition & 1 deletion controller/twitterController.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
}
});

if(process.env.NODE_ENV === "test"){
if(process.env.NODE_ENV === "development"){
query.limit(500);
}
query.exec();
Expand Down

0 comments on commit 0a95ae8

Please sign in to comment.