Skip to content

Commit

Permalink
Update App
Browse files Browse the repository at this point in the history
  • Loading branch information
gayankuruppu committed Dec 9, 2019
1 parent 0587a3e commit f97d733
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
8 changes: 4 additions & 4 deletions client/src/App.js
Expand Up @@ -34,10 +34,10 @@ function App() {
<div className="nav-scroller bg-white col-10 p-3 m-auto table-responsive"> <div className="nav-scroller bg-white col-10 p-3 m-auto table-responsive">
<h5>How it works?</h5> <h5>How it works?</h5>
<h6 className="pl-2 pr-2 pt-2 pb-1"> <h6 className="pl-2 pr-2 pt-2 pb-1">
List of most active GitHub users in the country over the past year based on public contributions of each user. List of most active GitHub users in the country over the past year based on public contributions of each user
</h6> </h6>
<h6 className="bg-light pl-2 pr-2 pt-1 pb-2"> <h6 className="bg-light pl-2 pr-2 pt-1 pb-2">
To contribute, create your pull request and add changes to the project <a href={"https://github.com/gayanvoice/githubstats-github-graphql"}>gayanvoice/githubstats-github-graphql</a>. To contribute, create your pull request and add changes to the project <a href={"https://github.com/gayanvoice/nodejs-graphql"}>gayanvoice/nodejs-graphql</a>
</h6> </h6>
</div> </div>


Expand Down Expand Up @@ -101,8 +101,8 @@ function App() {


<div className={'align-items-center p-3 mb-4 mt-3 text-center'}> <div className={'align-items-center p-3 mb-4 mt-3 text-center'}>
<span className={"ml-2"}><GitHubButton href="https://github.com/gayanvoice" data-size="large" data-show-count="true" aria-label="Follow @gayanvoice on GitHub">Follow @gayanvoice</GitHubButton></span> <span className={"ml-2"}><GitHubButton href="https://github.com/gayanvoice" data-size="large" data-show-count="true" aria-label="Follow @gayanvoice on GitHub">Follow @gayanvoice</GitHubButton></span>
<span className={"ml-2"}><GitHubButton href="https://github.com/gayanvoice/githubstats" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star gayanvoice/githubstats on GitHub">Star</GitHubButton></span> <span className={"ml-2"}><GitHubButton href="https://github.com/gayanvoice/nodejs-graphql" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star gayanvoice/nodejs-graphql on GitHub">Star</GitHubButton></span>
<div><small>Like this project? Go to <a href={'https://github.com/gayanvoice/githubstats-github-graphql'}>gayanvoice/githubstats-github-graphql</a></small></div> <div><small>Like this project? Go to <a href={'https://github.com/gayanvoice/nodejs-graphql'}>gayanvoice/nodejs-graphql</a></small></div>
<div><small>This project is not affiliated with the GitHub company in any way</small></div> <div><small>This project is not affiliated with the GitHub company in any way</small></div>
</div> </div>
</div> </div>
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -17,6 +17,7 @@
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"concurrently": "^5.0.0", "concurrently": "^5.0.0",
"express": "^4.17.1", "express": "^4.17.1",
"express-rate-limit": "^5.0.0",
"mongodb": "^3.3.3", "mongodb": "^3.3.3",
"react-share": "^3.0.1" "react-share": "^3.0.1"
} }
Expand Down
8 changes: 7 additions & 1 deletion server.js
Expand Up @@ -66,6 +66,12 @@ var country = [
]; ];
var start = true; var start = true;
const app = express(); const app = express();
var RateLimit = require('express-rate-limit');
var limiter = new RateLimit({
windowMs: 60*1000, // 1 minute
max: 5
});



// app keep alive // app keep alive
setInterval(function() { setInterval(function() {
Expand Down Expand Up @@ -135,7 +141,7 @@ app.get('/contributions/:country', (req, res) => {
} }
}); });


app.use(express.static(path.join(__dirname, 'client/build'))); app.use(limiter, express.static(path.join(__dirname, 'client/build')));
app.get('*', function(req, res) { app.get('*', function(req, res) {
try{ try{
res.sendFile(path.join(__dirname, 'client/build', 'index.html')); res.sendFile(path.join(__dirname, 'client/build', 'index.html'));
Expand Down

0 comments on commit f97d733

Please sign in to comment.