@loopback/docs
Version:
Documentation for LoopBack 4
36 lines (23 loc) • 1.17 kB
Markdown
lang: en
title: 'API docs: rest.restapplication.static'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.rest.restapplication.static.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/rest](./rest.md) > [RestApplication](./rest.restapplication.md) > [static](./rest.restapplication.static.md)
## RestApplication.static() method
Mount static assets to the REST server. See https://expressjs.com/en/4x/api.html\#express.static
<b>Signature:</b>
```typescript
static(path: PathParams, rootDir: string, options?: ServeStaticOptions): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| path | <code>PathParams</code> | The path(s) to serve the asset. See examples at https://expressjs.com/en/4x/api.html\#path-examples To avoid performance penalty, <code>/</code> is not allowed for now. |
| rootDir | <code>string</code> | The root directory from which to serve static assets |
| options | <code>ServeStaticOptions</code> | Options for serve-static |
<b>Returns:</b>
`void`