25 lines
578 B
Ruby
25 lines
578 B
Ruby
#! /usr/bin/env ruby
|
|
libdir = File.absolute_path( File.join( File.dirname(__FILE__), '../lib' ) )
|
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
|
|
|
Bundler.require(:default, :development)
|
|
|
|
|
|
require 'grack'
|
|
require 'rack'
|
|
root = File.absolute_path( File.join( File.dirname(__FILE__), '../examples' ) )
|
|
app = Grack::Server.new({
|
|
project_root: root,
|
|
upload_pack: true,
|
|
receive_pack:true
|
|
})
|
|
|
|
app1= Rack::Builder.new do
|
|
use Grack::Auth do |username, password|
|
|
[username, password] == ['123', '455']
|
|
end
|
|
run app
|
|
end
|
|
|
|
Rack::Server.start app: app1, Port: 3001
|
|
|