Skip to content

Instantly share code, notes, and snippets.

View pprathameshmore's full-sized avatar
🎯
Focusing

Prathamesh More pprathameshmore

🎯
Focusing
View GitHub Profile
import { config } from "dotenv";
config();
import http from "http";
import express, { Request, Response } from "express";
import { Server } from "socket.io";
import mongoose from "mongoose";
import cors from "cors";
import path from "path";
import morgan from "morgan";
import { SocketInit } from "./socket.io";
import axios from "axios";
import React from "react";
const FileDownload = require("js-file-download");
export default function VideoDownloader(props) {
console.log(props);
const { video } = props;
const { _id, title, thumbnail } = video;
const downloadVideo = async (event) => {
import React, { useEffect, useState } from "react";
import axios from "axios";
import toast, { Toaster } from "react-hot-toast";
import { io } from "socket.io-client";
import Videos from "./Videos";
const notify = (msg, { success }) => {
if (success) {
return toast.success(msg);
}
import axios from 'axios';
const response = await axios('https://quote-garden.herokuapp.com/api/v2/quotes/random');
console.log(response.data);
{
"name": "async-await-top",
"version": "1.0.0",
"description": "",
"main": "top-level-async-await.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
const { Worker, isMainThread, parentPort } = require('worker_threads');
if (isMainThread) {
console.log('Starting the main thread');
const worker = new Worker(__filename);
worker.on('message', (msg) => {
console.log(`Worker: ${msg}`);
});
console.log('Starting the main thread');
console.log('Getting started');
wasteTime();
console.log('In the middle');
wasteTime();
worker_processes 1;
http {
upstream nodejs-backend {
server localhost:4000;
}
include mime.types;
const express = require('express');
const app = express();
app.get('/hi', (req, res) => {
res.send('Hi! Reverse Proxy');
});
app.listen(4000, () => console.log('Server running on 4000'));
const express = require('express');
const app = express();
app.get('/hi', (req, res) => {
res.send('Hi! Reverse Proxy');
});
app.listen(4000, () => console.log('Server running on 4000'));