#1 Re: mORMot 1 » REST backend » 2015-10-23 09:06:52

knight_killer wrote:

Is it possible to add service methods dynamically without having them statically in published part of the RestServer?

Never mind. I found TSQLRestServer.ServiceMethodRegister()


Edit:

knight_killer wrote:

I thought I need a THTTPApiServer on top of one (or more) TSQLRestServer.

Ah, i mixed up THTTPApiServer with TSQLHttpServer. I don't need a THTTPApiServer, but a TSQLHttpServer and some TSQLRestServers (one for Nexus, one for custom service methods and one for static files like index.html)

#2 Re: mORMot 1 » REST backend » 2015-10-23 08:56:48

Thank you Arnaud

I thought I need a THTTPApiServer on top of one (or more) TSQLRestServer. I'm glad, if I don't need it.

After reading a lot of the Documentation and Code, I think I have to derive a own Server Class directly from TSQLRestServer and use a TSQLRestStorageExternal for it. Then I try to dynamically generate a Model from the existing Nexus Tables and add some custom method-based services (modular via a factory).

If that does not work (particularly the dynamic Model) I will use method-based services for the Nexus Tables as well.

Is it possible to add service methods dynamically without having them statically in published part of the RestServer?

Thanks
Roman

#3 mORMot 1 » REST backend » 2015-10-22 10:35:38

knight_killer
Replies: 3

I new to mORMot and I am trying to create a REST backend for a Single Page Application (AngularJS or EmberJS).

The main requirements of this backend are:
#1 make existing NexusDB Tables dynamically available as REST resources, that the JS frontend can access the Data with the standard HTTP methods
#2 we need to be able to define some Resources, that are not Tables but methods.
#3 Authorization based on user and REST resource / HTTP method
#4 deliver static Files (index.html, assets) - index.html should be default for root access http://1.2.3.4:8080/
#5 SSL

I started with THTTPApiServer, then I noticed, that I need a TSQLRestServer too for the Requirement #1. But then I need to define a static Model. I think TSQLDBServerHTTPApi and TSQLDBNexusDBConnection is not possible, because then I can't use REST, but only SQL-Queries.

Is there a possibility to generate a dynamic Model from existing Databases using TSQLDBNexusDBConnection or do you have an other idea for the requirements above?

#2 is no Problem (I think), just add some published Methods to a TSQLRestServer.
#3 depends on #1, but I think that should be easy
#4 I found this thread http://synopse.info/forum/viewtopic.php?id=2033
#5 easy

Thanks for pushing me in the right direction,
Roman

#4 Re: Low level and performance » Hash32: Lesser collisions? » 2011-11-18 10:24:11

ab wrote:

crc32 is the fastest and with less collisions (in the BYFOUR version)

Do you know http://www.team5150.com/~andrew/noncryptohashzoo/? It seems CRC32 isn't the fastest and has also some issues (Avalanche, Seed Avalanche and Bit Independence Criterion Tests). But the "CrapWOW" Hash seems pretty good... MurMur3 isn't bad too.
Too bad, they didn't tested the Google Hash (dense_hash_map) from http://code.google.com/p/google-sparsehash

Greets
knight_killer

Board footer

Powered by FluxBB