You are not logged in.
Pages: 1
Hello,
I am new to this stuff and I am about to create a kind of proxy RESTful service with mORMot.
I saw some sample code and it always refers TSQLHttpServer component.
Is there a way I can create non-SQL server?
Any suggestions are greatly appreciated.
Thanx a lot.
Offline
I modified the sample code like this. I do not have TSQLServerFullMemory class in my installation it seems...
When I run this, I get Access is denied. I think this is something to do with permissions....
Offline
Thank you, I got it running.
Now when I hit it at http://127.0.0.1:888/root I get
{
"errorCode":400,
"errorText":"Bad Request"
}
Where do I put the server logic?
Basically what I want to do is, determine the URI part, like "root" or "id1" or "id2" etc, and based on that ID to pass the request to another URL.
How do I go about that?
Thanx once again!
Offline
See the doc about services, e.g. method-based services or interface-based services.
For your use case, a method-based service may be good, since it gives full access to the HTTP context.
Offline
Is there any demos/sample code available?
I am studying the docs and determined it would make sense to use TSQLRestServerRemoteDB to create a proxy, but the docs do not give enough information to get into that stuff...
Offline
TSQLRestServerRemoteDB is for remote SQL/ORM execution, but a RESTful service using high-level parameters, and returning JSON may be a better design.
There are samples of TSQLRestServerRemoteDB in the regression tests - see TestSQLite3.dpr.
Offline
Okay, so for "better design" I inherit from TSQLRestServerFullMemory then, right?
What method do I override to deal with URI and redirect based on certain keywords found?
Also can I avoid "root" and have it like http://localhost:888/id1 etc?
Thank you.
Offline
Okay, I have found 04 - HTTP Client-Server sample and I think this will get me started in correct direction.
Offline
Pages: 1