Fixed issues with category routes and worked on post routes

This commit is contained in:
2023-02-02 15:26:47 -05:00
parent 555fc37047
commit 24e2326dc4
11 changed files with 513 additions and 53 deletions

View File

@@ -1 +1,24 @@
const backendURL = "http://127.0.0.1:8080";
const backendURL = "http://127.0.0.1:8080";
function setCookie(cname, cvalue, exdays) {
const d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
let expires = "expires=" + d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for (let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}