Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Commit

Permalink
remove global from rate-limit and improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
germanattanasio committed Oct 22, 2015
1 parent e2bd99d commit 52fa2ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions config/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ module.exports = function (app) {
app.use('/api/', rateLimit({
windowMs: 20 * 1000, // seconds
delayMs: 0,
max: 3,
global: false
max: 3
}));

};
6 changes: 1 addition & 5 deletions public/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ $(document).ready(function() {

$('.audio').on('error', function (err) {
$.get('/api/synthesize?text=test').always(function (response) {
var error = 'Error processing the request';
if (response.responseJSON && response.responseJSON.error) {
error = response.responseJSON.error;
}
showError(error);
showError(response.responseText || 'Error processing the request');
});
});

Expand Down

0 comments on commit 52fa2ec

Please sign in to comment.