Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
dd4d3276c4 | ||
|
515d5cb7c0 |
48
polymani.pl
48
polymani.pl
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* polimani.pl
|
* polimani.pl
|
||||||
*
|
*
|
||||||
* Assignment 1 - Polynomial Manipulator
|
* Assignment - Polynomial Manipulator
|
||||||
* Programming in Logic - DCC-FCUP
|
* Programming in Logic - DCC-FCUP
|
||||||
*
|
*
|
||||||
* Diogo Peralta Cordeiro
|
* Diogo Peralta Cordeiro
|
||||||
@ -40,6 +40,52 @@
|
|||||||
*/
|
*/
|
||||||
:- use_module(library(porter_stem)).
|
:- use_module(library(porter_stem)).
|
||||||
|
|
||||||
|
/*******************************
|
||||||
|
* WEB SETTINGS *
|
||||||
|
*******************************/
|
||||||
|
|
||||||
|
:- use_module(library(http/thread_httpd)).
|
||||||
|
:- use_module(library(http/http_dispatch)).
|
||||||
|
:- use_module(library(http/http_path)).
|
||||||
|
:- use_module(library(http/html_write)).
|
||||||
|
:- use_module(library(http/mimetype)).
|
||||||
|
:- use_module(library(http/http_error)).
|
||||||
|
:- use_module(library(settings)).
|
||||||
|
:- use_module(library(error)).
|
||||||
|
|
||||||
|
:- setting(http:served_file_extensions,
|
||||||
|
list(atom),
|
||||||
|
[ html ],
|
||||||
|
'List of extensions that are served as plain files').
|
||||||
|
:- setting(http:port,
|
||||||
|
integer,
|
||||||
|
3040,
|
||||||
|
'Default port').
|
||||||
|
|
||||||
|
% HTTP handler for pages
|
||||||
|
:- http_handler(root(''), web_polyplay, []).
|
||||||
|
|
||||||
|
/*******************************
|
||||||
|
* WEB SERVER *
|
||||||
|
*******************************/
|
||||||
|
|
||||||
|
server :-
|
||||||
|
setting(http:port, Port),
|
||||||
|
server([port(Port)]).
|
||||||
|
|
||||||
|
server(Options) :-
|
||||||
|
http_server(http_dispatch, Options).
|
||||||
|
|
||||||
|
/*******************************
|
||||||
|
* WEB SERVICES *
|
||||||
|
*******************************/
|
||||||
|
|
||||||
|
web_polyplay(_Request) :-
|
||||||
|
format('Content-type: text/html~n~n'),
|
||||||
|
format('Welcome to PolyMani!~n'),
|
||||||
|
format('Ask me something:~n'),
|
||||||
|
format('<form method="GET" action="process"><input type="text"></input></form>~n').
|
||||||
|
|
||||||
/*******************************
|
/*******************************
|
||||||
* NLP *
|
* NLP *
|
||||||
*******************************/
|
*******************************/
|
||||||
|
Reference in New Issue
Block a user