Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (36 sloc) 907 Bytes
<%
require "uri"
if ENV['DATABASE_URL']
database_url = URI.parse(ENV['DATABASE_URL'])
ENV['DB_HOST'] = database_url.host
ENV['DB_NAME'] = database_url.path.sub(/^\//,'')
ENV['DB_USERNAME'] = database_url.user
ENV['DB_PASSWORD'] = database_url.password
end
%>
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream database {
postgres_server <%= ENV['DB_HOST'] %>
dbname=<%= ENV['DB_NAME'] %>
user=<%= ENV['DB_USERNAME'] %>
password=<%= ENV['DB_PASSWORD'] %>;
}
server {
listen <%= ENV['PORT'] %>;
location /venues {
postgres_pass database;
rds_json on;
postgres_query "SELECT * FROM venues";
}
location / {
default_type text/html;
content_by_lua '
ngx.say("<p>hello, world</p>")
';
}
}
}
Something went wrong with that request. Please try again.