File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 1
1
import { Tools } from 'detritus-utils' ;
2
2
3
3
4
- export const LOCALHOST_API = 'http://localhost' ;
5
-
6
4
export enum Domains {
7
- CDN = 'https://cdn.notsobot.com/' ,
8
- BETA = 'https://beta.notsobot.com/' ,
9
- STABLE = 'https://notsobot.com/' ,
5
+ CDN = 'https://cdn.notsobot.com' ,
6
+ BETA = 'https://beta.notsobot.com' ,
7
+ LOCALHOST = 'http://localhost' ,
8
+ STABLE = 'https://notsobot.com' ,
10
9
}
11
10
12
11
export const Api = Object . freeze ( {
13
- URL : LOCALHOST_API ,
14
- URL_PUBLIC : Domains . BETA . slice ( 0 , - 1 ) ,
12
+ URL : Domains . BETA ,
13
+ URL_PUBLIC : Domains . BETA ,
15
14
PATH : '/api' ,
16
15
17
16
COMMANDS :
@@ -247,7 +246,7 @@ export const Api = Object.freeze({
247
246
248
247
249
248
export const CDN = Tools . URIEncodeWrap ( {
250
- URL : Domains . CDN . slice ( 0 , - 1 ) ,
249
+ URL : Domains . CDN ,
251
250
252
251
EMOJIS_APPLE : ( codepoint : string ) =>
253
252
`/emojis/apple/128x128/${ codepoint } .png` ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { RequestTypes } from 'detritus-client-rest';
3
3
import { Response , createHeaders } from 'detritus-rest' ;
4
4
import { HTTPMethods } from 'detritus-rest/lib/constants' ;
5
5
6
- import { Api , LOCALHOST_API } from './endpoints' ;
6
+ import { Api , Domains } from './endpoints' ;
7
7
import { RestOptions , RestResponsesRaw , RestResponses } from './types' ;
8
8
9
9
import {
@@ -30,7 +30,7 @@ export async function request(
30
30
options . url = Api . URL + Api . PATH ;
31
31
options . headers = createHeaders ( options . headers ) ;
32
32
33
- if ( Api . URL === LOCALHOST_API ) {
33
+ if ( Api . URL === Domains . LOCALHOST ) {
34
34
options . headers . set ( 'host' , 'beta.notsobot.com' ) ;
35
35
}
36
36
You can’t perform that action at this time.
0 commit comments