Access NGClient with nice urls

Forum to discuss the new web client version of Servoy.

Access NGClient with nice urls

Postby jdbruijn » Thu Apr 07, 2016 1:52 pm

Is it possible to provide access to the NGClient using nice urls.
For instance: https://www.example.com/welcome to access the inlog page, and next https://www.example.com/home to access the main page?

And to take it one step further, is this also possible:
https://customer_1.example.com/welcome to show a branded inlog page where the user doesnot have to enter his company name but only username/password
Jos de Bruijn
Focus Feedback BV
Servoy Certified Developer
Image
jdbruijn
 
Posts: 492
Joined: Sun Apr 11, 2010 6:34 pm

Re: Access NGClient with nice urls

Postby pbakker » Mon Apr 11, 2016 11:25 am

What is possible within the NGClient remains to be seen. Maybe it is possible to customize the router used internally by the NGClient, but I haven't attempted that (yet) not have I heared anyone else doing that.

However, usually your Servoy Application Server is not directly exposed to the internet, but access to it goes through a Reverse Proxy (usually based on Apache HTTP server or NGInx. Both support rewritting URL's, so if you have some naming convention/logic how to derive the formName (and thus NGClient url) from the nice url the user sees, you can use the url rewrite logic to get the 'nice url' part of your question done.

The second part (subdomains per (SaaS) customer) is for sure something you'd handle within the Reverse Proxy between the internet and your Servoy App Server. The implementation of it depends on the setup of your deployment architecture (1 big SaaS server hosting all your customers vs. multiple servers to host them all vs 1 server per customer etc). The whole thing starts with a wildcard entry in the DNS to whatever subdomains is put in from of example.com is supported and end up on your Reverse Proxy. The rest depends, as said, on your deployment architecture and how easy you want to have it to get a new customer up and running. Trying to lay out all options/scenarios/possibilities are too much to put on the forum, if you ask me.

Hope this helps,

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Access NGClient with nice urls

Postby sbutler » Mon Apr 18, 2016 3:29 am

jdbruijn wrote:Is it possible to provide access to the NGClient using nice urls.
For instance: https://www.example.com/welcome to access the inlog page, and next https://www.example.com/home to access the main page?


Yes. A few options. I'm personally not a fan of putting a proxy in front of the Servoy App server in all deployments. I think the only time you want something in front of your Servoy server is if you are using a load balancer and running several servoy app server instances. If your using a load balancer, you can setup some rules for how the URL structures work.
If you aren't using a load balancer, and just doing a normal servoy deployment, there are 2 main options.
1. Use iFrames. So in your application_server/server/webapps/ROOT folder, you can make some static .html pages that have a deep link into the web/NG client.
2. Use something like this to rewrite the URL's: http://tuckey.org/urlrewrite/ Its a similar concept to mod_rewrite in PHP. Works in Web and NG Client

jdbruijn wrote:And to take it one step further, is this also possible:
https://customer_1.example.com/welcome to show a branded inlog page where the user doesnot have to enter his company name but only username/password


Yes, this is easy to do in Servoy, Web Client or NG Client. On your Login page, in your onLoad, you can get the URL, and then retrieve the proper branding and render the login page accordingly. For example, I think the call is application.getServerURL() if I remember correctly. Then you can use security.authenticate(...) and pass in the url info, and have it return back the branding info so you can render the proper logo and company name.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Access NGClient with nice urls

Postby jdbruijn » Mon Apr 18, 2016 9:11 am

Thanks Paul and Scott,

I will look into your suggestions
Jos de Bruijn
Focus Feedback BV
Servoy Certified Developer
Image
jdbruijn
 
Posts: 492
Joined: Sun Apr 11, 2010 6:34 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 22 guests