Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## project/resources/blog.rb
- get '/blog' do
- erb :index
- end
- get '/blog/:id' do |id|
- halt 404 unless Integer(id) <= 0
- end
- post '/blog' do
- # post new blog.
- end
- put '/blog/:id' do |id|
- # update blog with :id.
- end
- delete '/blog/:id' do |id|
- # delete blog with :id
- end
- ## project/base.rb
- require 'rubygems'
- require 'sinatra'
- require 'erb'
- require 'resources/blog'
- require 'dm-core'
- configure :production do
- not_found do
- erb :"exceptions/notfound", :layout => :"layouts/exception"
- end
- error do
- erb :"exceptions/server_error", :layout => :"layouts/exception"
- end
- end
- configure :development do
- not_found do
- erb :"exceptions/notfound", :layout => :"layouts/exception"
- end
- end
Add Comment
Please, Sign In to add comment