-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from CorrectRoadH/main
feat: add custom memos url #1
- Loading branch information
Showing
5 changed files
with
141 additions
and
20 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import { URL } from 'url'; | ||
import Store from 'electron-store'; | ||
|
||
export function resolveHtmlPath() { | ||
export default function resolveHtmlPath() { | ||
const port = process.env.PORT || 8081; | ||
const url = new URL(`http://localhost:${port}`); | ||
const store = new Store(); | ||
|
||
const serverAddress = store.get('serverAddress') as string; | ||
const url = serverAddress | ||
? new URL(serverAddress) | ||
: new URL(`http://localhost:${port}`); | ||
url.pathname = ''; | ||
return url.href; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters