AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Delphi-PRAXiS - Lounge Delphi-News aus aller Welt RAD Server Support for Web Files in RAD Studio 10.2.3
Thema durchsuchen
Ansicht
Themen-Optionen

RAD Server Support for Web Files in RAD Studio 10.2.3

Ein Thema von DP News-Robot · begonnen am 16. Mär 2018
Antwort Antwort
Benutzerbild von DP News-Robot
DP News-Robot

Registriert seit: 4. Jun 2010
14.964 Beiträge
 
#1

RAD Server Support for Web Files in RAD Studio 10.2.3

  Alt 16. Mär 2018, 11:10
The RAD Server (formerly EMS) platform is evolving to be a better backend for JavaScript applications, including of course those built with Ext JS. In the 10.2.2 release we improved support for returning JSON data based on the result of database queries, as covered in*http://blog.marcocantu.com/blog/2017...ping-json.html.

In RAD Studio 10.2.3, we have added to RAD Server the ability to act as a Web Server, with the support for mapping URLs to folders and returning the content of files like HTML, JS, CSS, graphic, and more. This is a handy feature when using the local development and debugging version, so you don't need to configure both the web service and a separate web server for development, testing and debugging. We do not recommend using this approach for deployment: in that case RAD Server is deployed as a Web Server (Apache or IIS) plugin and the Web Server would of course support file mapping.

How do you configure RAD Server to return files? There is a new section in the EMS.INI file (notice this is a global configuration, not per module) when you can add virtual folders:

[Server.PublicPaths] ;# Identify directories that contain public files, such as .html ;# ;# The following entries define two different virtual directories ("images" and "content") ;# that may be used to access static files. The "directory" value indicates the physical ;# location of the static files. The optional "default" value indicates a file ;# that will be dispatched by default when browsing to the root of the virtual directory. ;# The optional "mimes" value is an array of MIME file type masks. And optional "extensions" ;# value is an array of file extensions. Only these files will be accessible from this directory. Path1={"path": "images", "directory": "C:||web||images||", "default": "index.html", "mimes": ["image/*"]} Path2={"path": "content", "directory": "C:||web||content||", "default": "index.html", "extensions": ["js", "html", "css"]} In this case I have two folders, one with images and one with HTML content, and also a default file with the URL refers to the folder as a whole. So I can now create a JavaScript application invoking a server method. To keep things simple, I've used a minimal jQuery application:

RAD Server JS + Service

Get RAD Server Content Result
When clicking on the button, the JS app will call the /xyz resource of the RAD Server project and display the result. This is the application in action in a browser (with the RAD Server log below):



Of course, our focus is to help build applications that use Ext JS as the client and RAD Server as the server. I'll make sure to follow uo with such a demo soon.



Weiterlesen...
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:26 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz