Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tabpy/tabpy_server/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from tabpy.tabpy_server.psws.callbacks import init_model_evaluator, init_ps_server
from tabpy.tabpy_server.psws.python_service import PythonService, PythonServiceHandler
from tabpy.tabpy_server.handlers import (
BaseStaticHandler,
EndpointHandler,
EndpointsHandler,
EvaluationPlaneHandler,
Expand Down Expand Up @@ -166,7 +167,8 @@ def try_exit(self):
),
(
self.subdirectory + r"/(.*)",
tornado.web.StaticFileHandler,
#tornado.web.StaticFileHandler,
BaseStaticHandler,
dict(
path=self.settings[SettingsParameters.StaticPath],
default_filename="index.html",
Expand Down
1 change: 1 addition & 0 deletions tabpy/tabpy_server/handlers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from tabpy.tabpy_server.handlers.management_handler import ManagementHandler

from tabpy.tabpy_server.handlers.endpoint_handler import EndpointHandler
from tabpy.tabpy_server.handlers.static_handler import BaseStaticHandler
from tabpy.tabpy_server.handlers.endpoints_handler import EndpointsHandler
from tabpy.tabpy_server.handlers.evaluation_plane_handler import EvaluationPlaneDisabledHandler
from tabpy.tabpy_server.handlers.evaluation_plane_handler import EvaluationPlaneHandler
Expand Down
1 change: 1 addition & 0 deletions tabpy/tabpy_server/handlers/base_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def initialize(self, app):
self.tabpy_state = app.tabpy_state
# set content type to application/json
self.set_header("Content-Type", "application/json")
self.set_header("TestHeader", "ThisIsATest")
self.protocol = self.settings[SettingsParameters.TransferProtocol]
self.port = self.settings[SettingsParameters.Port]
self.python_service = app.python_service
Expand Down
16 changes: 16 additions & 0 deletions tabpy/tabpy_server/handlers/static_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import base64
import binascii
import concurrent
import json
import logging
import tornado.web
import uuid




class BaseStaticHandler(tornado.web.StaticFileHandler):
def set_extra_headers(self, path):
# set content type to application/json
self.set_header("TestHeader", "ThisIsATest")
#self._headers["testheader"] = "test"