Skip to content

Instantly share code, notes, and snippets.

View tangb's full-sized avatar
👾

tangb

👾
View GitHub Profile
@tangb
tangb / dropbox.ts
Created June 17, 2022 13:45
My dropbox backend service (nestjs)
import { Dropbox, DropboxResponse, files as DropboxFiles, sharing } from 'dropbox';
import { IFilesProvider, ProviderFileLink, FILE_MIME_DIRECTORY, ProviderFileUpload } from './files-providers.types';
import mime from 'mime-types';
import { AppLoggerService } from '../logger/app-logger.service';
import 'isomorphic-fetch'; // fetch stuff for Dropbox
import { DropboxFile } from './dropbox-file.entity';
import { Readable } from 'stream';
import * as path from 'path';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const DropboxStream = require('dropbox-stream');