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

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

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

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

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

service.Setup(config).Start();
Console.WriteLine("Http服务器已启动");
```
