mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-03-12 17:51:53 +08:00
Compare commits
2 Commits
6d8b8d8400
...
feat/roadm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
663908c223 | ||
|
|
772c90c892 |
@@ -7,4 +7,6 @@ PUBLIC_STRIPE_INDIVIDUAL_MONTHLY_PRICE_ID=
|
||||
PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_ID=
|
||||
|
||||
PUBLIC_STRIPE_INDIVIDUAL_MONTHLY_PRICE_AMOUNT=10
|
||||
PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_AMOUNT=100
|
||||
PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_AMOUNT=100
|
||||
|
||||
ROADMAP_API_KEY=
|
||||
@@ -44,7 +44,9 @@ export async function httpCall<ResponseType = AppResponse>(
|
||||
: `${import.meta.env.PUBLIC_API_URL}${url}`;
|
||||
try {
|
||||
let visitorId = '';
|
||||
if (typeof window !== 'undefined') {
|
||||
|
||||
const isServer = typeof window === 'undefined';
|
||||
if (!isServer) {
|
||||
const fingerprintPromise = await fp.load();
|
||||
const fingerprint = await fingerprintPromise.get();
|
||||
visitorId = fingerprint.visitorId;
|
||||
@@ -59,6 +61,10 @@ export async function httpCall<ResponseType = AppResponse>(
|
||||
...(options?.headers ?? {}),
|
||||
});
|
||||
|
||||
if (isServer) {
|
||||
headers.set('roadmap-api-key', import.meta.env.ROADMAP_API_KEY);
|
||||
}
|
||||
|
||||
if (!isMultiPartFormData) {
|
||||
headers.set('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user