-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding web service capabilities and configuration
- Loading branch information
Luis Aguilar
committed
Nov 26, 2013
1 parent
4a0f5de
commit c30cc3c
Showing
2 changed files
with
46 additions
and
109 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
worker_processes 4; | ||
|
||
events {} | ||
|
||
http { | ||
upstream database { | ||
postgres_server 127.0.0.1 dbname=obidroid user=postgres password=i219kkls; | ||
} | ||
|
||
server { | ||
listen 8080; | ||
server_name localhost; | ||
|
||
location /appsByCategory { | ||
postgres_pass database; | ||
rds_json on; | ||
postgres_escape $category $arg_category; | ||
postgres_query "SELECT * FROM app WHERE category=$category"; | ||
postgres_rewrite HEAD GET no_rows 410; | ||
} | ||
|
||
location /reviewByAppId { | ||
postgres_pass database; | ||
rds_json on; | ||
postgres_escape $appid $arg_appid; | ||
postgres_query HEAD GET "SELECT * FROM review WHERE playappid=$appid"; | ||
postgres_rewrite HEAD GET no_rows 410; | ||
} | ||
|
||
location /appByAppId { | ||
postgres_pass database; | ||
rds_json on; | ||
postgres_escape $appid $arg_appid; | ||
postgres_query HEAD GET "SELECT * FROM app WHERE appid=$appid"; | ||
postgres_rewrite HEAD GET no_rows 410; | ||
} | ||
|
||
location /reviewsByCategory { | ||
postgres_pass database; | ||
rds_json on; | ||
postgres_escape $category $arg_category; | ||
postgres_query HEAD GET "SELECT app.appid, review.title, review.review FROM app, review WHERE app.category=$category AND app.appid=review.playappid"; | ||
postgres_rewrite HEAD GET no_rows 410; | ||
} | ||
} | ||
} |