@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
97 lines (48 loc) • 1.5 kB
Markdown
---
lang: en
title: 'API docs: rest.restserver.static'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest
permalink: /doc/en/lb4/apidocs.rest.restserver.static.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/rest](./rest.md) > [RestServer](./rest.restserver.md) > [static](./rest.restserver.static.md)
## RestServer.static() method
Mount static assets to the REST server. See https://expressjs.com/en/4x/api.html\#express.static
**Signature:**
```typescript
static(path: PathParams, rootDir: string, options?: ServeStaticOptions): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
path
</td><td markdown="1">
PathParams
</td><td markdown="1">
The path(s) to serve the asset. See examples at https://expressjs.com/en/4x/api.html\#path-examples
</td></tr>
<tr><td markdown="1">
rootDir
</td><td markdown="1">
string
</td><td markdown="1">
The root directory from which to serve static assets
</td></tr>
<tr><td markdown="1">
options
</td><td markdown="1">
ServeStaticOptions
</td><td markdown="1">
_(Optional)_ Options for serve-static
</td></tr>
</tbody></table>
**Returns:**
void