Page Contents

Home > @loopback/rest > RestServer > static

RestServer.static() method

Mount static assets to the REST server. See https://expressjs.com/en/4x/api.html#express.static

Signature:

static(path: PathParams, rootDir: string, options?: ServeStaticOptions): void;

Parameters

Parameter Type Description
path PathParams The path(s) to serve the asset. See examples at https://expressjs.com/en/4x/api.html#path-examples
rootDir string The root directory from which to serve static assets
options ServeStaticOptions (Optional) Options for serve-static

Returns:

void