#1 2015-05-17 04:20:31

delphiancoder
Member
Registered: 2015-03-04
Posts: 11

MVCServer : /blog path

Hi,

how to simply change the  /blog  path  to a root  /  ?

should be set with these ?

aHTTPServer.RootRedirectToURI
aServer.RootRedirectGet

no  success in replace string  /blog   /blog/default  with /


thanks!!

Offline

#2 2015-05-17 07:36:55

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: MVCServer : /blog path

Those methods do HTTP redirection, not HTTP path substitution.
So you could redirect / to /blog/default via aHTTPServer.RootRedirectToURI and /blog to /blog/Default via aServer.RootRedirectGet.

Path substitution only works with host virtual names by now, via DomainHostRedirect.
So you can redirect the blog.project2.com domain to root/blog/* URI for instance, but not redirect the /* sub URI to /blog/*.

Offline

#3 2015-05-17 09:17:43

delphiancoder
Member
Registered: 2015-03-04
Posts: 11

Re: MVCServer : /blog path

thanks for details explained !
I do some tests now.

so basically  /blog/default   could not became  /blog ?       is an attempt to short url lenght and get is clean

my attempt is also increase the structure add more tables and to something like this:

/blog1
/blog2

or 

/articles
/news
/video

and so on,  or

article.domain.com
video.domain.com
news.domain.com

where any site area is an independent blog where spidered links and extract wil be added with user posting featuers,  like demo already have

Offline

#4 2015-05-17 10:38:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: MVCServer : /blog path

article.domain.com
video.domain.com
news.domain.com
URI rewriting are handled by TSQLHttpServer.DomainHostRedirect

Other direct URI rewriting are not handled yet.

We may add it, but in real hosting on the web, TSQLHttpServer.DomainHostRedirect should be enough.
You would probably never access your http server from localhost, and if you do, you won't mind having verbose URI.
From the outside, you will use domain hosts, so TSQLHttpServer.DomainHostRedirect should be sufficient.

The fact that you can access the server from localhost is a detail.
Even with apache or nginx, the localhost URI do not match the domain host URIs.
And it is not an issue, IMHO.

Offline

#5 2015-06-08 08:07:52

tdanop
Member
Registered: 2015-01-16
Posts: 27

Re: MVCServer : /blog path

Hi, I am newbie to framework and i run the sample MVCServer. Just wondering how can i change the line of code where a TSQLRestServerDB is created
"aServer := TSQLRestServerDB.Create(aModel,ChangeFileExt(ExeVersion.ProgramFileName,'.db'));" instead of pointing to a SQL3 db to point to an MSSQL db.

Offline

#6 2015-06-08 08:19:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: MVCServer : /blog path

You should use an external database.
See http://synopse.info/files/html/Synopse% … l#TITL_146

This is what the https://github.com/synopse/mORMot/blob/ … greSQL.dpr sample does, for PostgreSQL.
Change the DB provider to point to MSSQL instead.
For MSSQL access, our SynOleDB.pas provider may be preferred.

Offline

#7 2015-06-08 10:15:45

tdanop
Member
Registered: 2015-01-16
Posts: 27

Re: MVCServer : /blog path

Thank you, I follow the MVCPostgress sample technique modifying for MSSQL and project run with success.
Is this the proper technique to follow in order to be indepented of all DB vendors by including all vendors in complie and choose one each time project runs in runtime?.

Offline

#8 2015-06-08 10:36:42

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVCServer : /blog path

I think that this could be done using ZEOS:

Zeos7.2-beta branches_ testing_Revision 3628:
http://svn.code.sf.net/p/zeoslib/code-0 … sting-7.2/
(Firebird/InterBase, MariaDB/MySQL, PostgreSQL, SQLite, Oracle, Sybase, MSSQL, ADO(Windows); Lazarus, Delphi, CodeTyphon; 32/64-bit).

Zeos7.3-beta branches_ testing_Revision 3632(test version):
http://svn.code.sf.net/p/zeoslib/code-0 … sting-7.3/
(Firebird/InterBase, MariaDB/MySQL, PostgreSQL, SQLite, Oracle, Sybase, MSSQL, ADO(Windows), OLE DB-MSSQL(Windows); Lazarus, Delphi, CodeTyphon; 32/64-bit).

http://zeoslib.sourceforge.net/viewtopi … &start=338

Arnaud, could you try to create such Universal MVC-Server Demo?

Michal

Offline

#9 2015-06-08 12:06:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: MVCServer : /blog path

How do you think an "Universal" demo may be?

All combinations of SQL engines + SQL access libraries are huge!

Offline

#10 2015-06-08 12:36:46

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVCServer : /blog path

@ab,

Similarly to SynDBExplorer with ConnectionStrings manager(it may be in the ini file).
Compiling with the entire ZEOS will increase MVC-Server 2-3MB.

Michal

Offline

Board footer

Powered by FluxBB