【文件属性】:
文件名称:限速
文件大小:38KB
文件格式:ZIP
更新时间:2021-02-17 13:44:29
Ruby
自述文件
限速模块,可阻止特定请求者在特定时间段(一小时)内发出太多http请求。
该解决方案实现了Rack中间件(RateLimit-固定窗口)来处理入站响应。
依存关系
要运行此项目,您需要:
Ruby 2.5.8-您可以使用
Rails 6.0
Redis 3.3
设置项目
$ git clone git@github.com:lorenadgb/rate-limiting.git克隆项目
$ cd rate-limiting -进入项目文件夹
入门
最快的入门方法是使用 。
$ docker-compose build
$ docker-compose up
运行测试
$ rake spec
终点
GET / api / v1 / home
Example: http://localhost:3000/api/v1/home
curl localhost:3000/
【文件预览】:
rate-limiting-master
----.gitignore(757B)
----Dockerfile(196B)
----app()
--------middleware()
--------models()
--------views()
--------channels()
--------controllers()
----config.ru(130B)
----bin()
--------rails(264B)
--------setup(1008B)
--------bundle(3KB)
--------spring(507B)
--------rake(213B)
----storage()
--------.keep(0B)
----.env.test(55B)
----log()
--------.keep(0B)
----.rubocop.yml(4KB)
----db()
--------seeds.rb(370B)
----.ruby-version(11B)
----public()
--------robots.txt(99B)
----.env(58B)
----docker-compose.yml(427B)
----spec()
--------middleware()
--------support()
--------requests()
--------spec_helper.rb(5KB)
--------rails_helper.rb(3KB)
----README.md(979B)
----vendor()
--------.keep(0B)
----.env.development(55B)
----config()
--------cable.yml(194B)
--------spring.rb(97B)
--------credentials.yml.enc(464B)
--------boot.rb(207B)
--------database.yml(620B)
--------routes.rb(157B)
--------environments()
--------environment.rb(128B)
--------application.rb(1KB)
--------storage.yml(1KB)
--------locales()
--------puma.rb(2KB)
--------initializers()
----lib()
--------tasks()
----tmp()
--------.keep(0B)
--------pids()
----Gemfile(1015B)
----Rakefile(227B)
----Gemfile.lock(5KB)