Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/backend/node_modules/koa2-ratelimit/test.js
Назад
const mongoose = require('mongoose'); const MongodbStore = require('./src/MongodbStore'); async function test() { await mongoose.connect('mongodb://localhost:27017/koa2-ratelimit'); const store = new MongodbStore(mongoose.connection, { collectionName: 'ratelimits', // table to manage the middleware collectionAbuseName: 'ratelimitsabuses', // table to store the history of abuses in. }); await store.Ratelimits.deleteMany({ }); const data = await Promise.all([ await store.incr('test', { interval: 1000 }, 1), await store.incr('test', { interval: 1000 }, 1), await store.incr('test', { interval: 1000 }, 1), await store.incr('test', { interval: 1000 }, 1), await store.incr('test', { interval: 1000 }, 1), await store.incr('test', { interval: 1000 }, 1), ]); console.log(data); } test();
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка