Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wearefarmgeek/tld_length
A Ruby Gem to handle subdomains on xip.io / nip.io domains using a rack middleware
https://github.com/wearefarmgeek/tld_length
Last synced: 4 days ago
JSON representation
A Ruby Gem to handle subdomains on xip.io / nip.io domains using a rack middleware
- Host: GitHub
- URL: https://github.com/wearefarmgeek/tld_length
- Owner: WeAreFarmGeek
- License: mit
- Created: 2014-10-26T00:28:46.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-10-27T14:49:48.000Z (about 4 years ago)
- Last Synced: 2024-11-06T22:57:25.405Z (6 days ago)
- Language: Ruby
- Size: 3.91 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# TldLength
Reconfigures ActionDispatch's TLD handling dynamically based on the request
host, so you don't have to mess with config.action_dispatch.tld_length for
cross-device testing using xip.io and friendsHeavily based on [Tim Lucas' Gist](https://gist.github.com/toolmantim/6632690).
## Installation:
The simplest way to use Rack::TldLength is to use Bundler.
Add Rack::TldLength to your `Gemfile`:
gem 'tld_length'
## Usage
Add the following line to your `config/environments/development.rb`:
config.middleware.use Rack::TldLength, /(x|n)ip\.io/, 5
And you're done!