Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco committed Apr 21, 2015
1 parent 63244a3 commit 5715922
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
10 changes: 10 additions & 0 deletions kong/web/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ app:get("/", function(self)
})
end)

app.default_route = function(self)
local path = self.req.parsed_url.path:match("^(.*)/$")

if path and self.app.router:resolve(path, self) then
return
end

return self.app.handle_404(self)
end

app.handle_404 = function(self)
return utils.not_found()
end
Expand Down
4 changes: 2 additions & 2 deletions kong/web/routes/base_controller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function BaseController.parse_params(schema, params)
end

function BaseController:new(dao_collection, collection)
app:post("/"..collection.."/", function(self)
app:post("/"..collection, function(self)
if not check_content_type(self.req, FORM_URLENCODED_TYPE) then
return utils.unsupported_media_type(FORM_URLENCODED_TYPE)
end
Expand All @@ -116,7 +116,7 @@ function BaseController:new(dao_collection, collection)
end
end)

app:get("/"..collection.."/", function(self)
app:get("/"..collection, function(self)
local size = self.params.size
if size then
size = tonumber(size)
Expand Down
19 changes: 12 additions & 7 deletions package-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ if [ "$(uname)" = "Darwin" ]; then
make install DESTDIR=$OUT
cd $OUT

# Install OpenSSL
cd $TMP
wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
tar xzf openssl-$OPENSSL_VERSION.tar.gz
cd openssl-$OPENSSL_VERSION
./Configure darwin64-x86_64-cc
make
sudo make install
cd $OUT

OPENRESTY_CONFIGURE="--with-cc-opt=-I$OUT/usr/local/include --with-ld-opt=-L$OUT/usr/local/lib"
FPM_PARAMS="--osxpkg-identifier-prefix org.getkong"
elif hash yum 2>/dev/null; then
Expand Down Expand Up @@ -74,13 +84,8 @@ else
exit 1
fi

cd $TMP
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar xvfvz ruby-2.1.2.tar.gz
cd ruby-2.1.2
./configure
make
sudo make install
curl -sSL https://get.rvm.io | bash -s stable
~/.rvm/scripts/rvm get stable

sudo gem update --system
sudo gem install fpm
Expand Down
1 change: 1 addition & 0 deletions versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ OPENRESTY_VERSION=1.7.10.2rc0
# Package builder only
LUA_VERSION=5.1.5
PCRE_VERSION=8.36
OPENSSL_VERSION=1.0.2a
KONG_VERSION=0.1.1beta-2

0 comments on commit 5715922

Please sign in to comment.