I use Dancer2 for all my personal stuff, from my automated grow room environment software to a system that fetches data from a Tesla API that I call from a microcontroller, that displays the battery status in my Tesla to remind me to plug the car in if needed when I pull into my garage. JSON in, process in Perl, JSON out.
Here's a link to the manual.
| [reply] |
Many thanks for your response.
Actually due to constraint I can't use dancer now but I will adopt this framework in my future work.
I intend to utilize sockets for achieving my goal. As this is simple client server problem where machines are on LAN. So how to utilize Perl sockets for developing Rest API server?
| [reply] |
| [reply] |
My recommendation is for REST::Application which I have used to construct several REST server applications. There is no tutorial as such but the POD is rather good and the Overview section gives a walk through of how to go about it.
| [reply] |
Personally I would prefer to use one of the standard Perl web frameworks (Dancer, Mojolicious or Catalyst). Dancer is the most minimal, but all 3 have a fair number of dependencies. Your requirements may be simple now, but these things have a way of growing, and you may then find that your lightweight choice will suffer growing pains.
One low-level option, if you really insist on it, is HTTP::Daemon. That's a subclass of IO::Socket::IP, which means you can play with sockets directly if you choose to. If you don't want to use the module directly, its source code might give you some inspiration.
| [reply] |
| [reply] |
Haven't personally used it but Raisin looks interesting. If I had to do something immediately I'd stick to Mojolicious though as I've got slightly more experience using it. Still haven't had call to use it much but it was easy to whip up something to serve as a slack (mattermost) slash command backend.
The cake is a lie.
The cake is a lie.
The cake is a lie.
| [reply] |