From adddd50c46c81ed291b7b106209bada771f8984c Mon Sep 17 00:00:00 2001 From: Anisha Keshavan Date: Sat, 24 Jun 2017 02:12:34 +0000 Subject: [PATCH] enh: added static server --- imports/python_generate/start_static_server | 11 +++++++++++ settings_freesurfer.json | 1 + 2 files changed, 12 insertions(+) create mode 100644 imports/python_generate/start_static_server diff --git a/imports/python_generate/start_static_server b/imports/python_generate/start_static_server new file mode 100644 index 0000000..7130cb5 --- /dev/null +++ b/imports/python_generate/start_static_server @@ -0,0 +1,11 @@ +#!/usr/bin/env python +import http.server +import os + +class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler): + def end_headers(self): + self.send_header("Access-Control-Allow-Origin", "*") + http.server.SimpleHTTPRequestHandler.end_headers(self) + +if __name__ == '__main__': + http.server.test(HandlerClass=MyHTTPRequestHandler, port=8080) diff --git a/settings_freesurfer.json b/settings_freesurfer.json index 39eed2b..1ddb6bb 100644 --- a/settings_freesurfer.json +++ b/settings_freesurfer.json @@ -1,6 +1,7 @@ { "public": { "startup_json":"http://localhost:8080/all_entries.json", + "load_if_empty": true, "modules": [ { "name": "Brainmask",