Created
April 20, 2009 14:43
-
-
Save jugyo/98567 to your computer and use it in GitHub Desktop.
Sinatra on GAE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
get '/' do | |
'Hello World!!' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> | |
<application>sinatra_on_gae</application> | |
<version>1</version> | |
<static-files /> | |
<resource-files /> | |
<sessions-enabled>false</sessions-enabled> | |
<system-properties> | |
<property name="jruby.management.enabled" value="false" /> | |
<property name="os.arch" value="" /> | |
<property name="jruby.compile.mode" value="JIT"/> <!-- JIT|FORCE|OFF --> | |
<property name="jruby.compile.fastest" value="true"/> | |
<property name="jruby.compile.frameless" value="true"/> | |
<property name="jruby.compile.positionless" value="true"/> | |
<property name="jruby.compile.threadless" value="false"/> | |
<property name="jruby.compile.fastops" value="false"/> | |
<property name="jruby.compile.fastcase" value="false"/> | |
<property name="jruby.compile.chainsize" value="500"/> | |
<property name="jruby.compile.lazyHandles" value="false"/> | |
<property name="jruby.compile.peephole" value="true"/> | |
</system-properties> | |
</appengine-web-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd sinatra_on_gae | |
mkdir WEB-INF | |
mkdir WEB-INF/gems WEB-INF/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install -i WEB-INF/gems sinatra --no-rdoc --no-ri | |
rm -rf WEB-INF/gems/bin WEB-INF/gems/cache/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libdir = File.dirname(__FILE__) | |
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir) | |
require 'sinatra/base' | |
require 'sinatra/main' | |
require 'sinatra/compat' | |
# This should comment out!! | |
#use_in_file_templates! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE web-app PUBLIC | |
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | |
"http://java.sun.com/dtd/web-app_2_3.dtd"> | |
<web-app> | |
<context-param> | |
<param-name>public.root</param-name> | |
<param-value>/</param-value> | |
</context-param> | |
<context-param> | |
<param-name>rackup</param-name> | |
<param-value>require 'rubygems' | |
require 'sinatra' | |
root_dir = File.dirname(__FILE__) | |
#set :environment, :production | |
set :environment, :development | |
set :root, root_dir | |
set :app_file, File.join(root_dir, 'app.rb') | |
disable :run | |
require 'app' | |
run Sinatra::Application | |
</param-value> | |
</context-param> | |
<context-param> | |
<param-name>jruby.min.runtimes</param-name> | |
<param-value>1</param-value> | |
</context-param> | |
<context-param> | |
<param-name>jruby.max.runtimes</param-name> | |
<param-value>1</param-value> | |
</context-param> | |
<context-param> | |
<param-name>jruby.init.serial</param-name> | |
<param-value>true</param-value> | |
</context-param> | |
<filter> | |
<filter-name>RackFilter</filter-name> | |
<filter-class>org.jruby.rack.RackFilter</filter-class> | |
</filter> | |
<filter-mapping> | |
<filter-name>RackFilter</filter-name> | |
<url-pattern>/*</url-pattern> | |
</filter-mapping> | |
<listener> | |
<listener-class>org.jruby.rack.RackServletContextListener</listener-class> | |
</listener> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment