---
id: httpstaticpageplugin
title: 静态页面插件
---

### 定义

命名空间：TouchSocket.Http <br/>
程序集：[TouchSocket.Http.dll](https://www.nuget.org/packages/TouchSocket.Http)

## 静态网页托管插件仅服务器支持

**HttpStaticPagePlugin**静态网页托管插件，是用于Http的内容响应。

```csharp showLineNumbers
var service = new HttpService();

var config = new TouchSocketConfig();
config.SetListenIPHosts(new IPHost[] { new IPHost(7789) })
    .ConfigurePlugins(a =>
    {
        a.UseHttpStaticPage()//添加静态页面文件夹
        .AddFolder("../../../../../api");

    });

await service.SetupAsync(config);

await service.StartAsync();

Console.WriteLine("Http服务器已启动");
```
