Skip to content

Latest commit

 

History

History
133 lines (84 loc) · 2.13 KB

resource-files-e179c0c.md

File metadata and controls

133 lines (84 loc) · 2.13 KB

Resource Files

The routing configuration for an application is defined in one or more destinations.

The application router is used to serve static content, authenticate users, rewrite URLs, and forward or proxy requests to other micro services while propagating user information. The following table lists the resource files used to define routes for multi-target applications:

Application-Router Resource Files Overview

File

Description

Mandatory

package.json

The package descriptor is used by the Node.js package manager (npm) to start the application router; in the “dependencies”: {} section

Yes

xs-app.json

The application descriptor contains the configuration used by the application router (for example, destinations for request forwarding)

Yes

resources/

A folder that contains all static resources which should be served by the application router. If no resources/ folder is present, the application router will not serve any static content. However, it still forwards requests to the configured destinations.

Tip:

If you have a static resources folder name in the xs-app.json file, we recommend that you use localDir as default.

No

local-destinations.json

Provides the required destinations information for local development

No

default-services.json

Defines the configuration for one or more special User Account and Authentication (UAA) services for local development

-

Sample Code:

xs-app.json

{
"source":"^/web-pages/(.*)$",
"localDir":"my-static-resources"
}