Difference between revisions of "Install REST"
From xPL
(→Install a web server) |
|||
Line 1: | Line 1: | ||
− | Controlling the home from distance can be made via web access methods such as the [http://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_APIs RESTful] API. | + | Controlling the home from distance can be made via standard web access methods |
+ | such as the [http://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_APIs RESTful] API. | ||
+ | |||
+ | Different options are available for the implementation of such a service: | ||
+ | * Installing a web server and writing CGI scipts | ||
+ | * Writing scripts serving a TCP socket and complying to the HTTP scheme | ||
+ | * Using a framework such as: | ||
+ | ** [https://metacpan.org/pod/HTTP::Server::Simple HTTP::Server::Simple] | ||
+ | ** [https://www.mojolicious.org/ Mojolicious] | ||
+ | I have chosen [https://mojolicious.org/perldoc/Mojolicious/Lite Mojolicious Lite] | ||
+ | for its simplicity and the ease of development. | ||
Before all, make sure you have installed an [[install xpl hub|xPL hub]]. | Before all, make sure you have installed an [[install xpl hub|xPL hub]]. | ||
+ | <!-- | ||
= Install a web server = | = Install a web server = | ||
Install [https://www.lighttpd.net/ lighttpd] and [http://www.php.net/ PHP]: | Install [https://www.lighttpd.net/ lighttpd] and [http://www.php.net/ PHP]: | ||
Line 25: | Line 36: | ||
Browse to the PC and check <code>index.php</code>. | Browse to the PC and check <code>index.php</code>. | ||
+ | --> | ||
+ | |||
+ | = Install Mojolicious Lite = | ||
+ | |||
+ | [https://metacpan.org/pod/Mojolicious::Lite Mojolicious::Lite] | ||
+ | can be installed with the standard [https://www.cpan.org/ CPAN] method. | ||
+ | For Debian and related distributions such as Ubuntu, a dedicated option is to use: | ||
+ | sudo apt install libmojolicious-perl | ||
[[Category: all]] [[Category: install]] [[Category: web]] | [[Category: all]] [[Category: install]] [[Category: web]] |
Revision as of 12:08, 12 May 2020
Controlling the home from distance can be made via standard web access methods such as the RESTful API.
Different options are available for the implementation of such a service:
- Installing a web server and writing CGI scipts
- Writing scripts serving a TCP socket and complying to the HTTP scheme
- Using a framework such as:
I have chosen Mojolicious Lite for its simplicity and the ease of development.
Before all, make sure you have installed an xPL hub.
Install Mojolicious Lite
Mojolicious::Lite can be installed with the standard CPAN method. For Debian and related distributions such as Ubuntu, a dedicated option is to use:
sudo apt install libmojolicious-perl