Summary of the file structure of the scripts folder:
/scripts/[serviceName].js ? javascript service (Web service endpoint at /services/[serviceName])
/scripts/[serviceName].resources ? automatically generated resources folder associated with the [serviceName] service.
/scripts/[serviceName].resources/www ? directory for resources to be exposed on the web at the URL (/services/[serviceName]/[resourceName]
/scripts/[serviceName].resources/www/index.htm[l] ? default UI for a service, exposed at /services/[serviceName]/index.htm, /services/[serviceName]/index.html/ and /services/[serviceName]
1.0 "Scripts" folder
Files with the ".js" extension placed within the {MashupServer}/scripts folder will be deployed as new Web services. Deployment is "hot", that is, a changed file will be redeployed within 10 seconds or less. For version 0.1, only scripts within the "scripts" directory will be deployed. Future versions will consider a more advanced folder structure\.
2.0 ".resources" folder
When a script is deployed, a folder to hold auxiliary resources is automatically created, using the name of the Javascript file, replacing ".js" by ".resources". This folder provides a way to associate additional resources with the service (e.g. a customized UI), as well as a sandbox for the use of the service (e.g., saving files) without affecting the operation of other deployed services. Files with the .js extension within a .resources folder are not deployed as new web services. This makes the .resources folder a good place to place include files.
3.0 Exposing Resources on the Web
Deployment of a .js file causes an endpoint address to be generated, and a service can be accessed from the URI http[s]://[mashup server domain]/services/[javascript service name]. Services are automatically deployed as HTTP endpoints, so operations can be invoked using [endpoint address]/[operation name]. For version 0.1, parameters are not accepted, but operations without input parameters can be accessed directly from the URI.
Sometimes there are other resources that need to be exposed, such as RSS or Atom feeds, XML documents, or Web pages. Documents placed within the .resources/www folder are exposed at the URL [endpoint address]/[resource name]. For example, the built-in version Javascript service has an endpoint of http[s]://[mashup server domain]/services/version. It comes with a file in scripts/version.resources/www called index.htm. This web page can be accessed using the URL http[s]://[mashup server domain]/services/version/index.htm.
The name index.htm or index.html is special - as with a normal Web server, this name operates as the default, so in fact the URL http[s]://[mashup server domain]/services/version will access index.htm and present a custom UI for the service. If no custom UI is found, the ?tryit page is displayed instead.
4.0 Related Resources