Skip to content

Commit

Permalink
new headers
Browse files Browse the repository at this point in the history
  • Loading branch information
zakandrewking committed Nov 23, 2016
1 parent 266e7ec commit 44fa50b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ temp_data/
*.swp
TAGS
.ipynb_checkpoints/
*.out
5 changes: 5 additions & 0 deletions bigg_models/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ def safe_query(func, *args, **kwargs):
session.close()

class BaseHandler(RequestHandler):
def set_default_headers(self):
self.set_header("Access-Control-Allow-Origin", "*")
self.set_header("Access-Control-Allow-Headers", "x-requested-with")
self.set_header('Access-Control-Allow-Methods', 'POST, GET, OPTIONS')

def write(self, value):
# note that serving a json list is a security risk
# This is meant to be serving public-read only data only.
Expand Down
1 change: 1 addition & 0 deletions bin/check_running
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh

. $BIGG/env/bin/activate
export PATH=/home/zaking/esolver_bin:$PATH

if ps -Af | grep -v grep | grep 'python -m bigg_models.server --port=8888'; then
echo Running;
Expand Down
4 changes: 3 additions & 1 deletion cron/check_running.crontab
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* * * * * /Users/dbuser/bigg_server/bigg_models/bin/check_running.sh 2>> /Users/dbuser/bigg_server/bigg_models.log
BIGG=/home/zaking/

01 * * * * /home/zaking/bigg_models/bin/check_running >> /home/zaking/cron_debug.log 2>&1

0 comments on commit 44fa50b

Please sign in to comment.