This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState } from "react" | |
export default function Index(){ | |
const [mounted, setMounted] = useState(false) | |
useEffect(() => { | |
setMounted(true) | |
}) | |
if (!mounted) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies | |
const express = require("express"); | |
const wifi = require("node-wifi"); | |
// Config | |
const serverApp = express(); | |
wifi.init({ | |
iface: null, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Linux-Based NodeJS Image as Base | |
FROM node:latest | |
# Install OpenSSL Library, required by Prisma | |
RUN apt-get install libssl3 | |
# Set WorkDir | |
WORKDIR /app | |
# Copy Package Files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatTime(seconds: number): string { | |
if (seconds <= 0) return '0s'; | |
const units: [number, string][] = [ | |
[86400, 'd'], | |
[3600, 'h'], | |
[60, 'm'], | |
[1, 's'] | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies | |
import { hash } from "jsr:@ts-rex/bcrypt"; | |
import { Hono } from "jsr:@hono/hono"; | |
import { encode } from "jsr:@gz/jwt"; | |
// Environment Variables | |
const DATABASE_URL = Deno.env.get("DATABASE_URL"); // Gets the DatabaseURL from the env. | |
const JWT_SECRET = Deno.env.get("JWT_SECRET"); // Gets the JWT Secret from the env. | |
// Create App |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies | |
import { Hono } from "jsr:@hono/hono"; | |
// Create App | |
const app = new Hono(); // Creates a new Hono instance. | |
// Time Conversion Function | |
// This function converts seconds to a readable time. | |
// Ex. 312312 = 3d 14h 45m 12s | |
function formatTime(seconds: number): string { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies | |
import wifi from "npm:node-wifi"; | |
import { Hono } from "jsr:@hono/hono"; | |
// Create App | |
const app = new Hono(); // Creates a new Hono instance. | |
wifi.init({ | |
// Initiates the Node Wifi library. | |
iface: null, | |
}); |