Added rate limiting and server security
Ton of little visual style tweaks and little up improvements for mobile
This commit is contained in:
1 parent
749d2cea94
commit
ecbf6a9cde
17 files changed
+283
-148
No files matched your search
@@ -3,10 +3,29 @@ require('module-alias/register')
|
||||
|
||||
let Auth = require('@helpers/Auth')
|
||||
|
||||
const helmet = require('helmet')
|
||||
|
||||
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
app.use( helmet() )
|
||||
const port = 3000
|
||||
|
||||
|
||||
//
|
||||
// Request Rate Limiter
|
||||
//
|
||||
const rateLimit = require('express-rate-limit');
|
||||
const limiter = rateLimit({
|
||||
windowMs: 10 * 60 * 1000, // minutes
|
||||
max: 1000 // limit each IP to 100 requests per windowMs
|
||||
});
|
||||
|
||||
// apply to all requests
|
||||
app.use(limiter);
|
||||
|
||||
|
||||
|
||||
var http = require('http').createServer(app);
|
||||
var io = require('socket.io')(http, {
|
||||
path:'/socket'
|
||||
|
||||
Reference in new issue
Block a user