mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix: remove leading front slash from HOST
This commit is contained in:
@@ -46,7 +46,7 @@ export default class Sync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _fetch(lastSynced, token) {
|
async _fetch(lastSynced, token) {
|
||||||
let response = await fetch(`${HOST}sync?lst=${lastSynced}`, {
|
let response = await fetch(`${HOST}/sync?lst=${lastSynced}`, {
|
||||||
headers: { ...HEADERS, Authorization: `Bearer ${token}` },
|
headers: { ...HEADERS, Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
return await response.json();
|
return await response.json();
|
||||||
@@ -83,7 +83,7 @@ export default class Sync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _send(data, token) {
|
async _send(data, token) {
|
||||||
let response = await fetch(`${HOST}sync`, {
|
let response = await fetch(`${HOST}/sync`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { ...HEADERS, Authorization: `Bearer ${token}` },
|
headers: { ...HEADERS, Authorization: `Bearer ${token}` },
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ async function authRequest(endpoint, data, auth = false, get = false) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let response = await fetch(`${HOST}${endpoint}`, {
|
let response = await fetch(`${HOST}/${endpoint}`, {
|
||||||
method: get ? "GET" : "POST",
|
method: get ? "GET" : "POST",
|
||||||
headers: { ...HEADERS, ...headers },
|
headers: { ...HEADERS, ...headers },
|
||||||
body: get ? undefined : JSON.stringify(data),
|
body: get ? undefined : JSON.stringify(data),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export const HOST =
|
export const HOST =
|
||||||
process.env.NODE_ENV === "production"
|
process.env.NODE_ENV === "production"
|
||||||
? "https://api.notesnook.com/"
|
? "https://api.notesnook.com"
|
||||||
: "http://0.0.0.0:8000/";
|
: "http://0.0.0.0:8000";
|
||||||
export const HEADERS = {
|
export const HEADERS = {
|
||||||
agent: "nn/1.0.0",
|
agent: "nn/1.0.0",
|
||||||
origin: "notesnook.com",
|
origin: "notesnook.com",
|
||||||
|
|||||||
Reference in New Issue
Block a user