Skip to content

Commit

Permalink
daemon or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo committed Aug 8, 2017
1 parent 1d7b623 commit a8fde4a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
17 changes: 17 additions & 0 deletions daemon.pl
@@ -0,0 +1,17 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

:- use_module(library(http/http_unix_daemon)).
:- initialization http_daemon.
4 changes: 2 additions & 2 deletions main.pl
Expand Up @@ -19,5 +19,5 @@
*/

main:-
load_files('graph'),
load_files('routes').
load_files('graph', [encoding(utf8)]),
load_files('routes', [encoding(utf8)]).
3 changes: 2 additions & 1 deletion server.pl
Expand Up @@ -23,9 +23,10 @@
:- use_module(library(http/json)).
:- use_module(library(http/http_json)).
:- use_module(library(http/json_convert)).
/*
:- use_module(library(http/http_unix_daemon)).
:- initialization http_daemon.

*/
:- http_handler('/metropolitana-milano', http_get_metropolitana_milano, []).

:- consult('main').
Expand Down
2 changes: 2 additions & 0 deletions start-daemon.sh
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
swipl -s daemon.pl server.pl --port=9876

0 comments on commit a8fde4a

Please sign in to comment.