Skip to content

Instantly share code, notes, and snippets.

View aboveStars's full-sized avatar
😁
wanna go to 'aboveStars'

Yunus Korkmaz aboveStars

😁
wanna go to 'aboveStars'
  • ITU Faculty of Computer and Informatics Engineering
  • Istanbul
  • 08:30 (UTC +03:00)
View GitHub Profile
@aboveStars
aboveStars / frenletUpdate.ts
Created May 30, 2024 17:07
Apidon Database Updates (Venus)
import { firestore } from "@/firebase/adminApp";
import { NextApiRequest, NextApiResponse } from "next";
const handleAuthorization = (authorization: string | undefined) => {
const updateAPIKey = process.env.VENUS_UPDATE_KEY;
if (!updateAPIKey) return false;
if (!authorization) return false;
return updateAPIKey === authorization;
@aboveStars
aboveStars / likeDataTransferAPI.ts
Created May 5, 2023 20:52
Creating "like activities" data for users in Firebase with typescript.
import { NextApiRequest, NextApiResponse } from "next";
import { fieldValue, firestore } from "../../firebase/adminApp";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
try {
const usersDocs = (await firestore.collection("users").get()).docs;