Skip to content

Commit 7b690cd

Browse files
committedSep 29, 2020
Add passenger app
1 parent 1871394 commit 7b690cd

File tree

6 files changed

+39
-0
lines changed

6 files changed

+39
-0
lines changed
 

‎ruby/passenger/Gemfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org/'
2+
3+
gem 'sinatra'
4+
gem 'passenger'

‎ruby/passenger/Passengerfile.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"engine": "builtin"
3+
}

‎ruby/passenger/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Ruby sample app using Passenger web server
2+
3+
## Building
4+
5+
`pack build passenger-sample --buildpack gcr.io/paketo-community/ruby`
6+
7+
## Running
8+
9+
`docker run --interactive --tty --env PORT=8080 --publish 8080:8080 passenger-sample`
10+
11+
## Viewing
12+
13+
`curl http://localhost:8080`

‎ruby/passenger/app.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'sinatra/base'
2+
3+
class ExampleApp < Sinatra::Base
4+
get '/' do
5+
erb :index
6+
end
7+
end

‎ruby/passenger/config.ru

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
require File.absolute_path("app.rb")
2+
3+
run ExampleApp

‎ruby/passenger/views/index.erb

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Powered By Paketo Buildpacks</title>
5+
</head>
6+
<body>
7+
<img style="display: block; margin-left: auto; margin-right: auto; width: 50%;" src="https://paketo.io/images/paketo-logo-full-color.png"></img>
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.