source: ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/wsgi/fileserver/test/fileserver_app.py @ 7024

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/wsgi/fileserver/test/fileserver_app.py@7024
Revision 7024, 987 bytes checked in by pjkersha, 10 years ago (diff)

Incomplete - task 9: Data Browser Replacement: ready for first release -

  • added regular expression filtering to avoid exposing unwanted content over HTTP interface
  • tested in paster test harness
  • tested PasteDeploy? interface
  • deleting remaining original wsgi-fileserver code
Line 
1#!/usr/bin/env python
2"""Test script to run file server application in the Paster web application
3server.
4"""
5__author__ = "P J Kershaw"
6__date__ = "15/06/10"
7__copyright__ = "(C) 2010 Science and Technology Facilities Council"
8__license__ = "BSD - see LICENSE file in top-level directory"
9__contact__ = "Philip.Kershaw@stfc.ac.uk"
10__revision__ = "$Id: $"
11import sys
12from os import path
13
14from ceda.server.wsgi.fileserver.test import PasteDeployAppServer
15
16THIS_DIR = path.abspath(path.dirname(__file__))
17INI_FILENAME = 'fileserver.ini'
18INI_FILEPATH = path.join(THIS_DIR, INI_FILENAME) 
19PORTNUM = 6080
20
21if __name__ == "__main__":
22    # Provide a port number as command line argument or accept the default
23    # PORTNUM
24    if len(sys.argv) > 1:
25        port = sys.argv[1]
26    else:
27        port = PORTNUM
28               
29    server = PasteDeployAppServer(cfgFilePath=INI_FILEPATH, port=port) 
30   
31    try:   
32        server.start()   
33    except KeyboardInterrupt:
34        sys.exit(0) 
Note: See TracBrowser for help on using the repository browser.