Skip to content

Commit 0e98585

Browse files
committed
fix: improve base url config
1 parent 814a860 commit 0e98585

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

src/config/baseClient.ts

-10
This file was deleted.

src/config/baseURL.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const URL_CLIENT = {
2+
development: 'http://localhost:3000',
3+
staging: 'https://staging.example.com',
4+
production: 'https://example.com',
5+
}
6+
7+
const URL_SERVER = {
8+
development: `http://localhost:${process.env.PORT || 8000}`,
9+
staging: 'https://api-staging.example.com',
10+
production: 'https://api.example.com',
11+
}
12+
13+
const ENV = process.env.NODE_ENV || 'development'
14+
15+
// @ts-ignore
16+
const BASE_URL_CLIENT = URL_CLIENT[ENV]
17+
// @ts-ignore
18+
const BASE_URL_SERVER = URL_SERVER[ENV]
19+
20+
export { BASE_URL_CLIENT, BASE_URL_SERVER }

0 commit comments

Comments
 (0)