#1 2016-08-21 10:40:13

talexone
Member
Registered: 2013-08-21
Posts: 21

Manually define MVC URI

Hi,

In framework documentation said:

In order to have the BLOG content hosted in root/blog URI, you should specify the expected sub-URI when initializing your TMVCApplication:

  procedure TBlogApplication.Start(aServer: TSQLRestServer);
  begin
  ...
  fMainRunner := TMVCRunOnRestServer.Create(self,nil,'blog').
  ...

,but in sample "30 - MVC Server" there is no sub-URI definition of the hosted MVC and it works:

  ...
  fMainRunner := TMVCRunOnRestServer.Create(Self).
  ...

How it works and is it possible to use root (/) instead of root/blog (/blog)?

Thanks
Alexandre

Offline

#2 2016-08-21 22:41:38

talexone
Member
Registered: 2013-08-21
Posts: 21

Re: Manually define MVC URI

It seems that the MVC URI defined in TSQLModel and not in TMVCRunOnRestServer as documentation said:

result := TSQLModel.Create([TSQLBookInfo,TSQLAuthor,
    TSQLTag,TSQLArticle,TSQLComment,TSQLArticleSearch],'blog');

And it seems I can't use a host's root as MVC root, cause TSQLModel will replace an empty URI string with 'root'. (I'm confused with using 'root', cause usually root means '/' and not '/root')

Did I missed something, but why MVC root URI was defined in TSQLModel?

Thanks,
Alexandre

Offline

Board footer

Powered by FluxBB