You are not logged in.
Pages: 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?
Sorry, I found them:
Ctxt.InHeader[RemoteIP]
Ctxt.InHeader[Host]
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?
You may use directly Ctxt.URIBlobFieldName, I guess.
But it does not work, when Parameter starts with any number.
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;
For example, full url is http://myserver/MyMethod/Parameter
How can I get Parameter as a string from Ctxt: TSQLRestServerURIContext object?
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.
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.
Pages: 1