Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Remove basepath from deferred urls and add trailing slash to root #342

Merged
merged 1 commit into from
Aug 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/api/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ async function execute(emitter: EventEmitter, {
const deferreds = new Map();

function get_deferred(pathname: string) {
pathname = pathname.replace(`/${basepath}`, '')
if (!deferreds.has(pathname)) {
deferreds.set(pathname, new Deferred()) ;
deferreds.set(pathname, new Deferred());
}

return deferreds.get(pathname);
Expand Down Expand Up @@ -138,6 +139,13 @@ async function execute(emitter: EventEmitter, {
}

return ports.wait(port)
.then(() => handle(new URL(`/${basepath}`, origin))) // TODO all static routes
.then(() => {
// TODO all static routes
if (basepath) {
return handle(new URL(`/${basepath}/`, origin));
} else {
return handle(new URL('/', origin));
}
})
.then(() => proc.kill());
}