https://github.com/iphoting/rackstaticapp
A tiny zero-config Rack App to serve static files
https://github.com/iphoting/rackstaticapp
Last synced: 3 months ago
JSON representation
A tiny zero-config Rack App to serve static files
- Host: GitHub
- URL: https://github.com/iphoting/rackstaticapp
- Owner: iphoting
- Created: 2023-09-10T08:42:16.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-10T14:22:49.000Z (over 1 year ago)
- Last Synced: 2025-01-20T04:18:43.385Z (5 months ago)
- Language: Ruby
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# RackStaticApp
`RackStaticApp` is a tiny, zero-configuration static file server built on top of `rack`. The source is extended from the [`Vienna` gem](https://github.com/kmikael/vienna/), with compatibility fixes for Rack 2 and Bundler 2.
The goal is to place everything in `/public`, add two lines to our `config.ru`
and let `RackStaticApp` take care of the rest.## Installation
Add this line to your application's Gemfile:
gem 'rackstaticapp'
And then execute:
bundle
Or install it yourself, run:
gem install rackstaticapp
## Usage
Place your static files in `/public`, optionally create `/public/404.html`
and add this to your `config.ru`:require 'rackstaticapp'
run RackStaticAppYou're done. Now you can deploy to `heroku`, `dokku` or any other place that supports rack-based apps. This should also work for most apps built with
[Jekyll](http://jekyllrb.com) or [Middleman](http://middlemanapp.com) as long as
you follow the conventions stated above.If you absolutely must change the root folder for some reason. You can use e.g.
`run RackStaticApp::Application.new('_site')` instead of `run RackStaticApp`.