Skip to content

Commit 334d369

Browse files
return string for url and use import.meta.env
1 parent 9f652d6 commit 334d369

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/urls.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ declare global {
1010
}
1111

1212
const DEFAULT_BASE_URL =
13-
process.env.ARCHIVE_BASE_URL ?? "https://archiveofourown.org";
13+
import.meta.env.ARCHIVE_BASE_URL ?? "https://archiveofourown.org";
1414

1515
globalThis.archiveBaseUrl = DEFAULT_BASE_URL;
1616

@@ -83,7 +83,7 @@ export const getAsShortUrl = ({ url }: { url: string | URL }) => {
8383
}
8484

8585
longUrl.host = "ao3.org";
86-
return longUrl;
86+
return longUrl.href;
8787
};
8888

8989
/**

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "@tsconfig/node-lts/tsconfig.json",
33
"compilerOptions": {
4-
"types": ["node"],
4+
"types": ["node", "vite/client"],
55
"moduleResolution": "bundler",
66
"module": "es2022",
77
"lib": ["es2022"],

0 commit comments

Comments
 (0)