web服务加入静态资源支持
This commit is contained in:
@@ -13,7 +13,8 @@ abstract class WebServer {
|
||||
|
||||
void start(int port,
|
||||
{Response? Function(Request, Map<String, dynamic>)? interceptor,
|
||||
Future<TokenResult> Function(String?)? tokenCheck});
|
||||
Future<TokenResult> Function(String?)? tokenCheck,
|
||||
StaticInfo? static});
|
||||
void stop();
|
||||
void addHandler(handler);
|
||||
}
|
||||
@@ -76,3 +77,9 @@ class TokenResult {
|
||||
Map<String, dynamic>? payload;
|
||||
TokenResult({required this.status, this.errMsg, this.payload});
|
||||
}
|
||||
|
||||
class StaticInfo {
|
||||
String path;
|
||||
String root;
|
||||
StaticInfo({this.path = "web", this.root = "index.html"});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user