feat: rebuild app using vike

This commit is contained in:
2024-02-22 12:15:04 +00:00
parent 87ef4ca1e3
commit 9777ae1676
104 changed files with 2214 additions and 2976 deletions
+2
View File
@@ -0,0 +1,2 @@
export const IS_DEV = process.env.NODE_ENV !== "production";
export const BASE_URL = process.env.BASE_URL || "";
+13
View File
@@ -0,0 +1,13 @@
import bcrypt from "bcrypt";
export const hashPassword = (password: string) => {
return bcrypt.hash(password, 10);
};
export const verifyPassword = async (hash: string, password: string) => {
try {
return await bcrypt.compare(password, hash);
} catch (err) {
return false;
}
};
+19
View File
@@ -0,0 +1,19 @@
import * as swc from "@swc/core";
export const transformJs = async (code: string) => {
try {
const result = await swc.transform(code, {
jsc: {
parser: {
jsx: true,
syntax: "ecmascript",
},
target: "es5",
},
});
return result.code;
} catch (err) {
return code;
}
};