refactor: refactoring common utilities

This commit is contained in:
Patrick Stewart 2024-12-15 03:56:25 -07:00
parent e25f672a40
commit 6981312866
2 changed files with 3 additions and 3 deletions

View file

@ -34,7 +34,7 @@ var pretty = prettyLog(
printFunction: stderr.writeln, printFunction: stderr.writeln,
omitError: (r) { omitError: (r) {
var err = r.error; var err = r.error;
return err is AngelHttpException && err.statusCode != 500; return err is PlatformHttpException && err.statusCode != 500;
}, },
); );
myLogger.onRecord.listen(pretty); myLogger.onRecord.listen(pretty);

View file

@ -5,7 +5,7 @@
void main() async { void main() async {
/* /*
var app = new Angel(); var app = new Angel();
var http = new AngelHttp(app); var http = new PlatformHttp(app);
var fs = const LocalFileSystem(); var fs = const LocalFileSystem();
var vDir = new _RangingVirtualDirectory(app, fs.currentDirectory); var vDir = new _RangingVirtualDirectory(app, fs.currentDirectory);
app.logger = new Logger('range_header') app.logger = new Logger('range_header')
@ -22,7 +22,7 @@ void main() async {
..addExtension('yaml', 'text/plain') ..addExtension('yaml', 'text/plain')
..addExtension('yml', 'text/plain'); ..addExtension('yml', 'text/plain');
app.fallback(vDir.handleRequest); app.fallback(vDir.handleRequest);
app.fallback((req, res) => throw new AngelHttpException.notFound()); app.fallback((req, res) => throw new PlatformHttpException.notFound());
await http.startServer('127.0.0.1', 3000); await http.startServer('127.0.0.1', 3000);
print('Listening at ${http.uri}'); print('Listening at ${http.uri}');
*/ */