Skip to content

Commit

Permalink
fix: http command
Browse files Browse the repository at this point in the history
- supported url with search params
  • Loading branch information
AxiosLeo committed May 27, 2024
1 parent 190f946 commit 0b6016f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class HttpCommand extends Command {
const router = new Router('/***', {
method: 'any',
handlers: [async (context) => {
let d = path.join(dir, context.url);
const url = new URL(context.url, 'http://localhost');
let d = path.join(dir, url.pathname);
printer.yellow(_fixed('[' + context.method + ']', 12, 'r')).green(context.url).println();
if (!await _exists(d)) {
error(404, 'Not Found');
Expand Down

0 comments on commit 0b6016f

Please sign in to comment.