#1 mORMot 1 » Cannot compile mORMot using FPC on Linux » 2019-01-08 01:21:05

vladon
Replies: 1
vladon@DESKTOP-ICBHBFC:~/mORMot$ ./build-fpc-linux64.sh
Free Pascal Compiler version 3.0.4+dfsg-18ubuntu2 [2018/08/29] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling ./SQLite3/TestSQL3.dpr
Compiling SynLZ.pas
SynLZ.pas(660,21) Warning: Local variable "cache" does not seem to be initialized
SynLZ.pas(1333,21) Warning: Local variable "cache" does not seem to be initialized
Compiling SynLZO.pas
SynLZO.pas(897,4) Warning: Label not defined "m3_m4_offset"
Compiling SynLizard.pas
Compiling SynCommons.pas
SynCommons.pas(6534,23) Warning: Some fields coming after "" were not initialized
SynCommons.pas(13656,42) Warning: Some fields coming after "VType" were not initialized
Compiling SynFPCLinux.pas
Compiling SynFPCTypInfo.pas
SynFPCTypInfo.pas(92,26) Error: Identifier not found "PRecInitData"
SynFPCTypInfo.pas(92,38) Error: Error in type definition
SynFPCTypInfo.pas(94,1) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

This is my configuration:

vladon@DESKTOP-ICBHBFC:~/mORMot$ fpc -iW
3.0.4+dfsg-18ubuntu2
vladon@DESKTOP-ICBHBFC:~/mORMot$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
vladon@DESKTOP-ICBHBFC:~/mORMot$ git rev-parse HEAD
b83b46c7320c9fd655223e3d19a1d701536e1c9b
vladon@DESKTOP-ICBHBFC:~/mORMot$ git remote show origin
* remote origin
  Fetch URL: git@github.com:synopse/mORMot.git
  Push  URL: git@github.com:synopse/mORMot.git
  HEAD branch: master

What have I done wrong?

#2 Re: mORMot 1 » [NOOBIE] How to get remote IP address and hostname in SQLRestServer? » 2015-01-05 12:46:02

Sorry, I found them:

Ctxt.InHeader[RemoteIP]
Ctxt.InHeader[Host]

smile

#3 mORMot 1 » [NOOBIE] How to get remote IP address and hostname in SQLRestServer? » 2015-01-05 12:18:44

vladon
Replies: 1

URLs like http://<myserver>:myport/root/mymethod

How in TSQLRestServerFullMemory descendant in TSQLRestServerFullMemory.MyMethod to get a remote IP and remote called hostname?

E.g. myserver1 = CNAME myserver, myserver2 = CNAME myserver.

Or how can I in one http server do different logic based on remote IP and hostname?

#4 Re: mORMot 1 » [NOOBIE] How to get method parameter after slash? » 2015-01-05 12:10:45

ab wrote:

You may use directly Ctxt.URIBlobFieldName, I guess.

But it does not work, when Parameter starts with any number.

#5 Re: mORMot 1 » [NOOBIE] How to get method parameter after slash? » 2015-01-05 01:51:43

Will this be OK?

function TCustomRestServer.GetAfterSlashParam(Ctxt: TSQLRestServerURIContext): string;
var
  uri, urifull: string;
begin
  uri := UTF8ToString(Ctxt.URI);
  urifull := UTF8ToString(Ctxt.URIWithoutSignature);

  Result := urifull.Substring(urifull.IndexOf(uri) + uri.Length + 1);
end;

#6 mORMot 1 » [NOOBIE] How to get method parameter after slash? » 2015-01-05 01:30:23

vladon
Replies: 3

For example, full url is http://myserver/MyMethod/Parameter

How can I get Parameter as a string from Ctxt: TSQLRestServerURIContext object?

#7 mORMot 1 » Very very simple REST server example » 2014-09-03 14:07:15

vladon
Replies: 1

I started to study mORMot and need an example of very simple REST server, which for example binds on port 8080, and on request GET http://localhost:8080/api/test replies with something like:

{
 "status": "OK",
 "description": "Test succeeded",
 "statusCode": 200,
 "data": null
}

Or how to process REST requests not mapping them to sqlite base, as in Example #28 (Simple RESTful ORM Server).


Could someone help me, please? Big thanks in advance.

#8 mORMot 1 » TSynLog / TSynLogDB / TSQLLog - what's the difference? » 2014-09-03 13:16:31

vladon
Replies: 1

What is the difference between TSynLog, TSynLogDB and TSQLLog?

And where is the TSynLogDB class defined? It appears in documentation, but there is no definition for this class in sources of mORMot.

Board footer

Powered by FluxBB