Skip to content

Commit

Permalink
Adding web service capabilities and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Aguilar committed Nov 26, 2013
1 parent 4a0f5de commit c30cc3c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 109 deletions.
109 changes: 0 additions & 109 deletions db/loadAppsReviews.py

This file was deleted.

46 changes: 46 additions & 0 deletions nginx_ws/conf/nginx.conf
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;
}
}
}

0 comments on commit c30cc3c

Please sign in to comment.