View source with formatted comments or as raw
    1/*  Part of SWI-Prolog
    2
    3    Author:        Jan Wielemaker
    4    E-mail:        J.Wielemaker@vu.nl
    5    WWW:           www.swi-prolog.org
    6    Copyright (c)  2010-2018, University of Amsterdam
    7                              VU University Amsterdam
    8    All rights reserved.
    9
   10    Redistribution and use in source and binary forms, with or without
   11    modification, are permitted provided that the following conditions
   12    are met:
   13
   14    1. Redistributions of source code must retain the above copyright
   15       notice, this list of conditions and the following disclaimer.
   16
   17    2. Redistributions in binary form must reproduce the above copyright
   18       notice, this list of conditions and the following disclaimer in
   19       the documentation and/or other materials provided with the
   20       distribution.
   21
   22    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   23    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   24    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   25    FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   26    COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
   27    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   28    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   29    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   30    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   31    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
   32    ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   33    POSSIBILITY OF SUCH DAMAGE.
   34*/
   35
   36:- module(conf_network, []).   37:- use_module(library(settings)).   38
   39/** <module> Configure the HTTP server
   40
   41Change the default port on which the HTTP server listens. If the port is
   42an integer, the server is  available   from  all  interfaces. The common
   43alternative is `localhost:Port`, binding  the   server  to  th localhost
   44network only. This is particularly intertesting if  the same host runs a
   45reverse proxy.
   46
   47If host-detection does not work  or  this   server  is  behind a reverse
   48proxy, you may also need the   public_host/public_port  settings to tell
   49ClioPatria where it can be reached.
   50
   51The =prefix= setting rebases all paths on   the  server to the indicated
   52path. Note that the prefix has *no* trailing /. E.g. a setting =|/demo|=
   53changes the root of the server to  =|/demo/|=. Rebasing a server is only
   54possible if internal path dependencies use   the  HTTP path mechanism to
   55find paths for internal services.
   56
   57The setting =workers= sets the number of   HTTP  worker threads. See the
   58link below for more info.
   59
   60@see    localhost.pl
   61@see    http_location_by_id/2 and http_link_to_id/3 for finding the
   62        locations of internal services.
   63@see    http://www.swi-prolog.org/howto/http/HTTPScale.html for more
   64        info on server scalability.
   65*/
   66
   67% :- set_setting_default(http:port, 8080).
   68% :- set_setting_default(http:port, localhost:8080).
   69% :- set_setting_default(http:public_host, 'www.example.org').
   70% :- set_setting_default(http:public_port, 80).
   71% :- set_setting_default(http:prefix, '/demo').
   72% :- set_setting_default(http:workers, 16).
   73
   74% Allow  CORS  enabled  access  by    default.   Needed  for  JavaScript
   75% applications loaded from other sites  to   access  the SPARQL endpoint
   76% other JSON or XML APIs of ClioPatria.   One of the features that needs
   77% it is YASGUI for accessing the server on http://localhost
   78
   79:- set_setting_default(http:cors, [*]).