class Object

Constants

DB_FILE

Here you can configure where you want the database file to be saved

ROOT_FOLDER

tomafro.net/2010/01/tip-relative-paths-with-file-expand-path

SQL_FILE

sql file name goes here, the default is database.sql

Public Instance Methods

make_router() click to toggle source
# File template/routes.rb, line 3
def make_router
  router = WhalesDispatch::Router.new

  router.draw do
    # include routes using this syntax:
    # get Regexp.new("^/users/new$"), UsersController, :new
    # or
    # resources :users, :parent, only: [:new]
    #
    # nested resources are given as blocks to :parent resources
    # resources :posts, :parent do
    #   resources :comments, :nested, only: [:index, :new, :create]
    # end
  end

  router
end
start_server(router) click to toggle source
# File server.rb, line 3
def start_server(router)

  server = WEBrick::HTTPServer.new(Port: 3000)
  server.mount_proc('/') do |req, res|
    route = router.run(req, res)
  end

  trap('INT') { server.shutdown }

  server.start

  server
end