#1 2018-05-03 16:10:56

RedOctober
Member
Registered: 2018-05-03
Posts: 3

Beginner needs guidance - Lazarus HTTPS REST Server

I used to use Delphi 1 to XE7. Then it got too pricey and buggy.  Now I use Lazarus (1.8.2) on Free Pascal (3.0.4) and target only the Windows 10 platform on full size desktop computers (for now). I have written an app in Lazarus that I now need to build a "licensing" module for.  I asked about Delphi MVC being ported to Lazarus FPC, on the DMVC Facebook Page and Daniel Teti said that DMVC wd not be ported to Lazarus.  One of the other ppl in the DMVC FB group told me about mORMot.  After trying to plow through the massive introduction docs, I'm lost as to where to begin.  To make this simple, I'll state there what I am trying to accomplish, and if some kind person could tell me how to do it with mORMot, I will learn the rest as I need to.

Project Goal:

I build small utilities that I would like to have a "licensing" function in, that ensures that my end user has a paid for license to use my software.  Let's call it the "LF" for short.  The job of the LF is very simple.  When the utility software first starts, it asks the end user for the GUID (license key) that I have sent them via email.  After the user types in the License Key, in the background, the LF calls into a dedicated server at my home office, using HTTPS REST web technology, and submits the license key.  The REST server decides if it is a legitimate license key and responds with one of two phrases to be shown to the end user:  "Success! You are licensed!" or "Invalid License Key".. AS WELL AS.. in the background, not shown to the user, a text BLOB, which is just the end user's name and address and email address, and, another GUID which is the "hidden" license key.

What I don't need help with:

I can write the client side LF in Lazarus.  I can handle all the database stuff.  I use Firebird 3x RDBMS.

What I DO need help with:

- How do I build the HTTPS REST server side that does what I want using mORMot in Lazarus?
- How do I build the Licensing Function into my existing Lazarus FPC client that "talks to" the mORMot server side in Lazarus?

Thanks in advance for any help you can provide.

To be clear:

This is not to produce any kind of visible web page.  My utilities run only on Windows 7 to 10 and my server is a Windows 2016 Essentials server.

Last edited by RedOctober (2018-05-03 16:13:03)

Offline

#2 2018-05-03 16:44:29

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: Beginner needs guidance - Lazarus HTTPS REST Server

Isn't DasBoot better? I expect mORMot can do it but it may take more reading of the docs...

Offline

#3 2018-05-03 16:45:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,706
Website

Re: Beginner needs guidance - Lazarus HTTPS REST Server

You want to create a service.

Perhaps a method-based service is enough for your purpose.
See the doc about it.

Offline

#4 2018-05-03 17:08:46

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Beginner needs guidance - Lazarus HTTPS REST Server

Starting with the official documentation is the wrong path.

Try start with the samples, for your specific needs, check https://github.com/synopse/mORMot/blob/ … Server.dpr

And this blog series: https://tamingthemormot.wordpress.com/


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#5 2018-05-03 23:38:58

rdevine
Member
Registered: 2014-02-20
Posts: 52

Re: Beginner needs guidance - Lazarus HTTPS REST Server

@RedOctober - I agree with edwinsn. Start with the samples, identify key classes that are used and search the forums for other info, then use the docs to complete the picture. The forums are a goldmine of useful info and you'll find it's not as complicated as it first appears.

Offline

Board footer

Powered by FluxBB