Skip to content

noma4i/air-attack

Repository files navigation

Air-Attack sample app

This is simple skinny rails app in (json api only mode) to show how to rate limit requests and test em with rspec.

Why

RED notification

Time between reviews ~10 days.

First attempt

Done with rack-attack Result: ** ASKED NOT TO USE GEMS **

Second attempt

Dead simple middleware. Result: pending

Basic

Functionality

  • Return OK

Limitations & Thoughts

Requirements

  • Ruby >= 2.2.2 minimum requirement comes from rails 5.1
  • Redis >= 2.0

or

  • docker

Configuration

User .env or .env.local to configure connection to redis This app comes pre-configured but you can change rule in rate-limit.yml

How to run?

for development bundle install and rails server

or

docker-compose up - will run in production mode

Testing

do bundle exec rspec

Caveats

If you Redis is not up and running the app will ignore that while friendly giving blody r RED notification

License

Air-Attack is freely distributable under the terms of an MIT-style licence.

Copyright notice and permission notice shall be included in all copies or substantial portions of the Software.

About

Coding challenge for Airtasker

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published