Skip to content

Commit 6dd326f

Browse files
dunglasmysiar
authored andcommitted
Fix entrypoint generation (#45)
1 parent 352b747 commit 6dd326f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/generators/BaseGenerator.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ export default class {
4646

4747
createEntrypoint(apiEntry, dest) {
4848
const url = urlapi.parse(apiEntry);
49-
const {protocol, host, port, pathname} = url;
50-
const hostUrl = `${protocol}//${host}${port ? `:${port}` : ''}`;
49+
const {protocol, host, pathname} = url;
5150

52-
this.createFile('_entrypoint.js', dest, {host: hostUrl, path: pathname}, false);
51+
this.createFile('_entrypoint.js', dest, {host: `${protocol}//${host}`, path: pathname}, false);
5352
}
5453

5554
getHtmlInputTypeFromField(field) {

templates/_entrypoint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export const API_HOST = "{{{host}}}";
2-
export const API_PATH = "{{{path}}}";
1+
export const API_HOST = '{{{host}}}';
2+
export const API_PATH = '{{{path}}}';

0 commit comments

Comments
 (0)