From f721f0146d1a66e9528ac72704351c470d9dd691 Mon Sep 17 00:00:00 2001 From: Roy Li Date: Sat, 21 Nov 2020 11:41:17 +0800 Subject: [PATCH] feat: change api endpoint --- rollup.config.js | 3 +++ src/api.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index cdb0095..652db97 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -33,6 +33,9 @@ export default { 'process.env.NODE_ENV': JSON.stringify( process.env.NODE_ENV || 'development', ), + 'process.env.__VERSION__': JSON.stringify( + require('./package.json').version, + ), }), nodePolyfills(), typescript({}), diff --git a/src/api.ts b/src/api.ts index cdc6fb0..e03b830 100644 --- a/src/api.ts +++ b/src/api.ts @@ -11,7 +11,7 @@ export class Api { case 'deepl': return 'https://api.deepl.com' case 'sub-deepl': - return 'https://sub-deepl.nerdynerd.org' + return 'https://sub-deepl-api.nerdynerd.org' case 'local': return 'http://localhost:1337' } @@ -40,6 +40,7 @@ export class Api { url, header: { 'Content-Type': 'application/x-www-form-urlencoded', + 'User-Agent': 'sub-deepl-bob/' + process.env.__VERSION__, }, body, })