This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regex1 = new RegExp("0*[01]1*"); | |
const regex2 = new RegExp("([00]|[01]|[10]|[11])*[01]([00]|[01]|[10]|[11])*"); | |
const regex3 = new RegExp("(00|01|10|11)*0|1(00|01|10|11)*"); | |
const regex4 = new RegExp("(00|01|10|11)*(0|1)(00|01|10|11)*"); | |
console.log("111".match(regex1)); | |
console.log("111".match(regex2)); | |
console.log("111".match(regex3)); | |
console.log("111".match(regex4)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const RateLimit = require('express-rate-limit'); | |
const limiter = new RateLimit({ | |
windowMs: 15 * 60 * 1000, // 15 minutes | |
max: 100, // limit each IP to 100 requests per windowMs | |
delayMs: 0 // disable delaying - full speed until the max limit is reached | |
}); | |
app.use(limiter); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
var expressSanitizer = require('express-sanitizer'); | |
var bodyParser = require('body-parser'); | |
const app = express(); | |
const router = express.Router(); | |
const PORT = process.env.PORT || 3001; | |
app.use(bodyParser.json()); |