Skip to content

Commit

Permalink
feat(next/api): translate api url config
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjdd committed May 7, 2024
1 parent 6da3cdb commit 62f4d70
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion next/api/src/service/translate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import axios from 'axios';

export class TranslateService {
private fanyiURL = process.env.FANYI_URL || 'https://fanyi.leanapp.cn/';

private fanyiToken = process.env.FANYI_TOKEN;

async translate(text: string) {
Expand All @@ -9,7 +11,7 @@ export class TranslateService {
}

const res = await axios.post(
'https://fanyi.leanapp.cn/',
this.fanyiURL,
{ text },
{
headers: {
Expand Down

0 comments on commit 62f4d70

Please sign in to comment.