Update index.js
Browse files820 unmodified lines8218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379387 unmodified lines946947948837949950951952820 unmodified lines const file = File.fromURL(url); await file.loadAttributes(); let data = await file.downloadBuffer(); mime.types['py'] = 'text/x-python'; // Pythonmime.types['java'] = 'text/x-java-source'; // Javamime.types['c'] = 'text/x-c'; // Cmime.types['cpp'] = 'text/x-c++src'; // C++mime.types['cc'] = 'text/x-c++src'; // C++mime.types['cxx'] = 'text/x-c++src'; // C++mime.types['cs'] = 'text/x-csharp'; // C#mime.types['php'] = 'application/x-httpd-php'; // PHPmime.types['rb'] = 'text/x-ruby'; // Rubymime.types['pl'] = 'text/x-perl'; // Perlmime.types['sh'] = 'application/x-sh'; // Shell Scriptmime.types['go'] = 'text/x-go'; // Gomime.types['swift'] = 'text/x-swift'; // Swiftmime.types['kt'] = 'text/x-kotlin'; // Kotlinmime.types['rs'] = 'text/x-rustsrc'; // Rustmime.types['scala'] = 'text/x-scala'; // Scalamime.types['r'] = 'text/x-r-source'; // Rmime.types['R'] = 'text/x-r-source'; // R (alternatif untuk huruf besar)mime.types['lua'] = 'text/x-lua'; // Luamime.types['md'] = 'text/markdown'; // Markdownmime.types['json'] = 'application/json'; // JSONmime.types['js'] = 'application/javascript'; // JavaScriptmime.types['ts'] = 'application/x-typescript'; // TypeScriptmime.types['xml'] = 'application/xml'; // XMLmime.types['yaml'] = 'application/x-yaml'; // YAMLmime.types['yml'] = 'application/x-yaml'; // YAML (alternatif)mime.types['html'] = 'text/html'; // HTMLmime.types['htm'] = 'text/html'; // HTML (alternatif)mime.types['css'] = 'text/css'; // CSSmime.types['scss'] = 'text/x-scss'; // SCSS (Sass)mime.types['sass'] = 'text/x-sass'; // Sassmime.types['less'] = 'text/x-less'; // Lessmime.types['coffee'] = 'text/coffeescript'; // CoffeeScriptmime.types['dart'] = 'application/dart'; // Dartmime.types['sql'] = 'application/sql'; // SQLmime.types['vb'] = 'text/x-vbscript'; // VBScriptmime.types['vbs'] = 'text/x-vbscript'; // VBScript (alternatif)mime.types['bat'] = 'application/x-msdos-program'; // Batch scriptmime.types['cmd'] = 'application/cmd'; // Command scriptmime.types['ps1'] = 'application/x-powershell'; // PowerShell scriptmime.types['ini'] = 'text/plain'; // INI filemime.types['toml'] = 'application/toml'; // TOMLmime.types['cfg'] = 'text/plain'; // Configuration filemime.types['conf'] = 'text/plain'; // Configuration filemime.types['properties'] = 'text/plain'; // Properties filemime.types['log'] = 'text/plain'; // Log filemime.types['yml'] = 'application/x-yaml'; // YAML filemime.types['rst'] = 'text/x-rst'; // reStructuredTextmime.types['latex'] = 'application/x-latex'; // LaTeXmime.types['tex'] = 'application/x-tex'; // TeXmime.types['bib'] = 'text/x-bibtex'; // BibTeXmime.types['mat'] = 'application/x-matlab-data'; // MATLABmime.types['m'] = 'text/x-matlab'; // MATLAB or Objective-Cmime.types['octave'] = 'text/x-octave'; // GNU Octavemime.types['rmd'] = 'text/x-r-markdown'; // R Markdownmime.types['jl'] = 'text/x-julia'; // Juliamime.types['clj'] = 'text/x-clojure'; // Clojuremime.types['cljs'] = 'text/x-clojurescript'; // ClojureScriptmime.types['cljc'] = 'text/x-clojure'; // Clojure (Common)mime.types['erl'] = 'text/x-erlang'; // Erlangmime.types['hs'] = 'text/x-haskell'; // Haskellmime.types['lhs'] = 'text/x-literate-haskell'; // Literate Haskellmime.types['ml'] = 'text/x-ocaml'; // OCamlmime.types['mli'] = 'text/x-ocaml'; // OCaml Interfacemime.types['fs'] = 'text/x-fsharp'; // F#mime.types['fsi'] = 'text/x-fsharp'; // F# Interactivemime.types['fsx'] = 'text/x-fsharp'; // F# Scriptmime.types['fsscript'] = 'text/x-fsharp'; // F# Script (alternative)mime.types['elm'] = 'text/x-elm'; // Elmmime.types['elm'] = 'application/elm'; // Elm (alternative)mime.types['ex'] = 'text/x-elixir'; // Elixirmime.types['exs'] = 'text/x-elixir'; // Elixir Scriptmime.types['eex'] = 'text/x-eex'; // Elixir Embedded Templatesmime.types['html.eex'] = 'text/x-html-elixir'; // Elixir HTML Embedded Templatesmime.types['hx'] = 'text/x-haxe'; // Haxemime.types['hxml'] = 'application/hxml'; // Haxe XMLmime.types['sml'] = 'text/x-sml'; // Standard MLmime.types['thy'] = 'text/x-isabelle-theory'; // Isabelle Theorymime.types['lean'] = 'text/x-lean'; // Leanmime.types['v'] = 'text/x-verilog'; // Verilogmime.types['sv'] = 'text/x-systemverilog'; // SystemVerilogmime.types['vhd'] = 'text/x-vhdl'; // VHDLmime.types['vhdl'] = 'text/x-vhdl'; // VHDL (alternative)mime.types['scm'] = 'text/x-scheme'; // Schememime.types['ss'] = 'text/x-scheme'; // Scheme (alternative)mime.types['rkt'] = 'text/x-racket'; // Racketmime.types['lisp'] = 'text/x-common-lisp'; // Common Lispmime.types['asd'] = 'text/x-common-lisp'; // Common Lisp ASDFmime.types['cl'] = 'text/x-common-lisp'; // Common Lisp (alternative)mime.types['el'] = 'text/x-emacs-lisp'; // Emacs Lispmime.types['sc'] = 'text/x-supercollider'; // SuperCollidermime.types['f'] = 'text/x-fortran'; // Fortranmime.types['f90'] = 'text/x-fortran'; // Fortran (alternative)mime.types['f95'] = 'text/x-fortran'; // Fortran (alternative)mime.types['v'] = 'text/x-vim'; // Vim Scriptmime.types['pro'] = 'text/x-prolog'; // Prologmime.types['pl'] = 'text/x-prolog'; // Prolog (alternative to Perl)mime.types['p'] = 'text/x-pascal'; // Pascalmime.types['pas'] = 'text/x-pascal'; // Pascal (alternative)mime.types['d'] = 'text/x-d'; // Dmime.types['ada'] = 'text/x-ada'; // Adamime.types['adb'] = 'text/x-ada'; // Ada Bodymime.types['ads'] = 'text/x-ada'; // Ada Specificationmime.types['nim'] = 'text/x-nim'; // Nimmime.types['nimble'] = 'text/x-nim'; // Nimblemime.types['cr'] = 'text/x-crystal'; // Crystalmime.types['cl'] = 'text/x-clarion'; // Clarionmime.types['prg'] = 'text/x-clarion'; // Clarion Programmime.types['l'] = 'text/x-lex'; // Lex/Flexmime.types['yy'] = 'text/x-bison'; // Bison/Yaccmime.types['bison'] = 'text/x-bison'; // Bison/Yacc (alternative)mime.types['mly'] = 'text/x-menhir'; // Menhir let {fileTypeFromBuffer} = await (await import('file-type')) return res.json({message:"Success",7 unmodified lines })} catch (e) { console.log(e); return res.json({ message: e.message, return res.json({ message: "Internal Server Error", code: 500 });}index.js+113-1