Skip to content

Instantly share code, notes, and snippets.

@blizzarddreams
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save blizzarddreams/f92a63012ef1c1ed2dbe to your computer and use it in GitHub Desktop.

Select an option

Save blizzarddreams/f92a63012ef1c1ed2dbe to your computer and use it in GitHub Desktop.
require 'sinatra/base'
require 'sinatra'
require 'mongoid'
Dir.glob('/controllers/*.rb').each { |file| require file }
configure do
Mongoid.load!("./mongoid.yml")
end
class ApplicationController < Sinatra::Base
set :root, File.dirname(__FILE__)
enable :sessions
get '/' do
erb :login
end
end
require 'sinatra'
#in /controllers/
class PostController < ApplicationController
get '/posts' do
@post = Post.all
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment