1#!/usr/local/bin/swipl
2
3:- module(logicmoo_swish, [ ]). 4
5:- use_module(library(http/thread_httpd)). 6:- use_module(library(http/http_dispatch)). 7:- use_module(library(broadcast)). 9
11
13
14:- multifile sandbox:safe_primitive/1. 15
16sandbox:safe_primitive(tlbugger:rtracing).
17sandbox:safe_primitive(tlbugger:dont_skip_bugger).
18sandbox:safe_primitive(tlbugger:skip_bugger).
19sandbox:safe_primitive(tlbugger:skipMust).
20:- forall(current_predicate(tlbugger:P),asserta(sandbox:safe_primitive(tlbugger:P))). 21
22
23:- set_prolog_flag(no_sandbox, true). 24
26:- remove_undef_search. 29:- add_history((repeat,sleep(10),make,join_threads,fail)). 31run_logicmoo_swish:-
32 set_prolog_flag(toplevel_goal, prolog),
33 current_prolog_flag(argv, Argv),
34 argv_options(Argv, _, Options),
35 option(port(Port), Options, 3020),
36 ( option((public true), Options)
37 -> Address=Port
38 ; Address=localhost:Port
39 ),
40 broadcast(http(pre_server_start)),
41 http_server(http_dispatch,
42 [ port(Address),
43 workers(6)
44 ]),
45 broadcast(http(post_server_start))