A tiny, asynchronous static file server with optional Markdown rendering, built on Protocol::HTTP and Async.
- Static files via
Luna::Middleware::Static - Optional Markdown-to-HTML via
Luna::Middleware::Markdown(usingmarkly) - Simple verbose logging via
Luna::Middleware::Verbose
Add this line to your application's Gemfile:
gem "luna"
And then execute:
bundle install
Or install it yourself as:
gem install luna
Serve the current directory:
luna --bind http://localhost:3000
Options:
--root PATH(default: current directory)--index FILENAME(default:index.html)--[no]-directory-listing(default:true)--[no]-markdown(default:true)--[no]-verbose--bind URL(default:http://localhost:3000)
require "async"
require "async/http/endpoint"
require "luna/server"
endpoint = Async::HTTP::Endpoint.parse("http://localhost:3000")
app = Luna::Server.middleware(root: "/path/to/root", markdown: true)
Async do |task|
server = Luna::Server.new(app, endpoint, protocol: endpoint.protocol)
server.run
end
There are no documented releases.
We welcome contributions to this project.
- Fork the repository.
- Create your feature branch (
git checkout -b my-new-feature). - Commit your changes (
git commit -am 'Add some feature.'). - Push to the branch (
git push origin my-new-feature). - Create a new pull request.
To run the test suite:
$ bundle exec susTo make a new release:
$ bundle exec bake gem:release:patch # or minor or majorIn order to protect users of this project, we require all contributors to comply with the Developer Certificate of Origin. This ensures that all contributions are properly licensed and attributed.
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.