#1 Re: mORMot 2 » Rerouting to REST server method » 2024-01-22 17:05:04

Sorry... my bad! it's working... it ran into my catchall which was returning the code 400. wink

#2 mORMot 2 » Rerouting to REST server method » 2024-01-22 16:47:48

ulrichd
Replies: 1

Is it possible to re-route requests to existing REST server methods?

I tried adding:

    aRestServer := TVspsRestServer.CreateWithOwnModel([], False, 'vsps');
    try
      aHttpServer := TRestHttpServer.Create(SERVER_PORT, [aRestServer], '+', useHttpSocket);
      try
        aHttpServer.AccessControlAllowOrigin := '*';
        aHttpServer.Route.Get('/vsps/test', '/vsps/createport');

but am getting a 400 - Bad Request when I try a GET on /vsps/test.

the method is defined as:

procedure TVspsRestServer.CreatePort(Ctxt: TRestServerURIContext);

#3 Re: mORMot 1 » Seeking advice: mORMot + Vue.js app » 2018-10-23 21:07:59

mpv,

was already thinking along those lines.  Thanks for sharing the config sample and the link!

#4 Re: mORMot 1 » Seeking advice: mORMot + Vue.js app » 2018-10-23 17:37:22

Hi ab,

yes, the front-end will call REST endpoints where appropriate.

I had started experimenting with a mORMotHttpServer Request override, but it looks like I would have to handle everything myself that way (correct me if I'm wrong), including session management and paying attention to when it's a static content request and when it's a REST call (since I used '/' as the additionalUrl in the Create call).

I'll explore the idea of using nginx to serve the front-end.

Thanks for sharing your insight!

#5 mORMot 1 » Seeking advice: mORMot + Vue.js app » 2018-10-23 15:13:19

ulrichd
Replies: 4

Looking for some advice on how to approach a project with mORMot serving as the back-end to a Vue.js based front-end.

We currently have a working application that uses mORMot MVC templates to serve a browser based UI, with some interface based code to do the required work on the server.  The plan is to upgrade the UI using Vue.js.  Since this would shift the view and controller part to the client, the server would only need to server static files.

What would be the best approach?

Drop the MVC part, keep the interface code and have mORMot server the UI as static files?

Use a dedicated web server (e.g. nginx) to serve the UI files, only keeping the mORMot interface code?

Or another, even better approach? smile

Any insights are welcome.

#6 Re: mORMot 1 » Invalid OSVersion results » 2018-10-16 17:56:22

Thanks ab.  That did the trick!

Was that mentioned anywhere in the mORMot docs?  Looks like I missed that...

#7 mORMot 1 » Invalid OSVersion results » 2018-10-15 17:41:04

ulrichd
Replies: 3

Do I have to call a function before I can use OSVersion or OSVersionText?

I'm running an application on Windows 10 Pro, yet OSVersionText gives me "Windows 8 64bit (6.2.9200)".  winver.exe says "Version 1803 (OS Build 17134.286)".  mORMot is at 1.18.4847.

#8 Re: mORMot 1 » WinHTTP security error » 2018-07-31 13:28:00

ab wrote:

I guess some deprecated protocol problem: the server doesn't accept some TLS protocols, which are set by Windows Seven.

Hadn't thought of that!

Ok, I'll probably end up adding some code to only set the property if it's running on a system with a know certificate issue.

Thanks for help, much appreciated.

Regards,
Ulrich

#9 Re: mORMot 1 » WinHTTP security error » 2018-07-30 18:42:37

ab wrote:

You can try to set the THttpRequest.IgnoreSSLCertificateErrors property, which is exactly for such cases.

Thanks ab, that makes the error go away.

I can't help wondering though what can of worms I open by setting this property?

Is there no way of finding out what winhttp is bothered by?

#10 mORMot 1 » WinHTTP security error » 2018-07-30 13:39:40

ulrichd
Replies: 4

First post, so: thanks for the mORMot Framework - great stuff!

Now on to the issue at hand...

Got an odd problem here: I have a server/client application that communicates via SSL secured interface functions.  So far, everything has been working great and I have no issue running server and client on two different Windows 10 PCs.  However, I just installed my client on Windows 7 and it's giving me the following error:

20180727 20361848  ! debug RequestSync
20180727 20361848  !  +    mORMotHttpClient.TSQLHttpClientWinHTTP(028DDDB0).CallBackGet ols/Timestamp
20180727 20361848  !  +    	mORMotHttpClient.TSQLHttpClientWinHTTP(028DDDB0).InternalURI GET
20180727 20361856  ! EXC   		EWinHTTP ("WinHTTP security error. Status 65536, statusInfo: 16") at 0074FA18 SynCrtSock.TWinHTTP.InternalConnect (10491)  stack trace API 
20180727 20361857  !  -    	00.137.235
20180727 20361857  !  -    00.137.254
20180727 20361857  ! warn  mORMotHttpClient.TSQLHttpClientWinHTTP(028DDDB0) /Timestamp call failed -> Server not available
20180727 20361857  ! info  mORMotHttpClient.TSQLHttpClientWinHTTP(028DDDB0) Destroy ols

How can I find out what exactly the problem is, or where the status/statusinfo values for this error are defined?

I'm suspecting the client on Windows 7 doesn't like something about the certificate of the server, as there's nothing logged about the connection attempt on the server side.

The certificate I'm using on the server side is created on demand during installation (as it has to be customized to the server: SAN field holds host name and IP address). The CA certificate that is used to sign the server certificate was added to the "Local Computer\Trusted Root Certification Authorities" on the client.

BTW: browsing to the MVC web page of the server works fine from Windows 7 (no certificate issues).

Any pointers would be greatly appreciated!

Board footer

Powered by FluxBB