|
@@ -5,11 +5,10 @@ import rateLimit from 'express-rate-limit';
|
|
|
import routes from './api/routes/bDateRoutes.js'; // importing routes
|
|
import routes from './api/routes/bDateRoutes.js'; // importing routes
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
-* @returns {ExpressApp}
|
|
|
|
|
-*/
|
|
|
|
|
-function createServer () {
|
|
|
|
|
- const app = express();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ * @param {ExpressApp} app
|
|
|
|
|
+ * @returns {ExpressApp}
|
|
|
|
|
+ */
|
|
|
|
|
+function createServer (app = express()) {
|
|
|
app.use(rateLimit({
|
|
app.use(rateLimit({
|
|
|
windowMs: 1 * 60 * 1000, // 1 minute
|
|
windowMs: 1 * 60 * 1000, // 1 minute
|
|
|
max: 20
|
|
max: 20
|