apex
Apex is a RubyMotion web framework for OS X. It uses GCDWebServer under the hood and provides a Sinatra-like router and DSL.
Apex is currently experimental and in development. I'd love to have help; feel free get in touch on Twitter.
Installation
# In Gemfile:
gem 'apex'
# In Terminal:
bundle install
rake pod:install
Usage
class AppDelegate < Apex::Server
port 8080 # defaults to 8080
layout do
"<html>" +
"<head><title>Apex</title></head>" +
"<body>" +
content +
"</body>" +
"</html>"
end
get "/" do |r|
"<h1>Apex is running. Response: #{r}</h1>" +
"<p><a href='/about'>About Apex</a></p>"
end
get "/about" do |r|
"<h1>About Apex</h1>" +
"<p><a href='/'>Home</a></p>"
end
post "/some_post" do |request|
request.headers["User-Agent"]
end
end
Contributing
- Fork it
- 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 new Pull Request