This is a parody of leetcode.com for designers. It's being developed live on Twitch.tv/zedashaw to demonstrate how to make a parody of a website.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
pixelperfectionist/api/problems.js

63 lines
3.5 KiB

import * as models from "../lib/models.js";
import * as queues from "../lib/queues.js";
import logging from '../lib/logging.js';
import assert from 'assert';
import { API } from '../lib/api.js';
const log = logging.create(import.meta.url);
const reply_data = {
problems: [
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-check", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
{title: "Fake Title", solution: "file-video", acceptance: "40%", difficulty: "Moderate", frequency: "lock", id: 1},
],
companies: [
{name: "Amazon", count: 1230},
{name: "Google", count: 1205},
{name: "Microsoft", count: 748},
{name: "Facebook", count: 690},
{name: "Apple", count: 625},
{name: "Bloomberg", count: 606},
{name: "Adobe", count: 514},
{name: "Uber", count: 439},
{name: "Oracle", count: 225},
{name: "TikTok", count: 201},
{name: "Goldman", count: 203},
{name: "Sachs", count: 193},
{name: "LinkedIn", count: 174},
{name: "Yahoo", count: 170},
{name: "ByteDance", count: 300},
]
}
export const get = async (req, res) => {
const api = new API(req, res);
try {
log.debug(reply_data);
api.reply(200, reply_data);
} catch (error) {
log.error(error);
api.error(500, error.message || "Internal Server Error");
}
}