Update index.js
Browse files
index.js
CHANGED
|
@@ -821,118 +821,118 @@ try {
|
|
| 821 |
const file = File.fromURL(url);
|
| 822 |
await file.loadAttributes();
|
| 823 |
let data = await file.downloadBuffer();
|
| 824 |
-
|
| 825 |
-
|
| 826 |
-
|
| 827 |
-
|
| 828 |
-
|
| 829 |
-
|
| 830 |
-
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
|
| 860 |
-
|
| 861 |
-
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
|
| 875 |
-
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
| 928 |
-
|
| 929 |
-
|
| 930 |
-
|
| 931 |
-
|
| 932 |
-
|
| 933 |
-
|
| 934 |
-
|
| 935 |
-
|
| 936 |
let {fileTypeFromBuffer} = await (await import('file-type'))
|
| 937 |
return res.json({
|
| 938 |
message:"Success",
|
|
|
|
| 821 |
const file = File.fromURL(url);
|
| 822 |
await file.loadAttributes();
|
| 823 |
let data = await file.downloadBuffer();
|
| 824 |
+
mimes.types['py'] = 'text/x-python'; // Python
|
| 825 |
+
mimes.types['java'] = 'text/x-java-source'; // Java
|
| 826 |
+
mimes.types['c'] = 'text/x-c'; // C
|
| 827 |
+
mimes.types['cpp'] = 'text/x-c++src'; // C++
|
| 828 |
+
mimes.types['cc'] = 'text/x-c++src'; // C++
|
| 829 |
+
mimes.types['cxx'] = 'text/x-c++src'; // C++
|
| 830 |
+
mimes.types['cs'] = 'text/x-csharp'; // C#
|
| 831 |
+
mimes.types['php'] = 'application/x-httpd-php'; // PHP
|
| 832 |
+
mimes.types['rb'] = 'text/x-ruby'; // Ruby
|
| 833 |
+
mimes.types['pl'] = 'text/x-perl'; // Perl
|
| 834 |
+
mimes.types['sh'] = 'application/x-sh'; // Shell Script
|
| 835 |
+
mimes.types['go'] = 'text/x-go'; // Go
|
| 836 |
+
mimes.types['swift'] = 'text/x-swift'; // Swift
|
| 837 |
+
mimes.types['kt'] = 'text/x-kotlin'; // Kotlin
|
| 838 |
+
mimes.types['rs'] = 'text/x-rustsrc'; // Rust
|
| 839 |
+
mimes.types['scala'] = 'text/x-scala'; // Scala
|
| 840 |
+
mimes.types['r'] = 'text/x-r-source'; // R
|
| 841 |
+
mimes.types['R'] = 'text/x-r-source'; // R (alternatif untuk huruf besar)
|
| 842 |
+
mimes.types['lua'] = 'text/x-lua'; // Lua
|
| 843 |
+
mimes.types['md'] = 'text/markdown'; // Markdown
|
| 844 |
+
mimes.types['json'] = 'application/json'; // JSON
|
| 845 |
+
mimes.types['js'] = 'application/javascript'; // JavaScript
|
| 846 |
+
mimes.types['ts'] = 'application/x-typescript'; // TypeScript
|
| 847 |
+
mimes.types['xml'] = 'application/xml'; // XML
|
| 848 |
+
mimes.types['yaml'] = 'application/x-yaml'; // YAML
|
| 849 |
+
mimes.types['yml'] = 'application/x-yaml'; // YAML (alternatif)
|
| 850 |
+
mimes.types['html'] = 'text/html'; // HTML
|
| 851 |
+
mimes.types['htm'] = 'text/html'; // HTML (alternatif)
|
| 852 |
+
mimes.types['css'] = 'text/css'; // CSS
|
| 853 |
+
mimes.types['scss'] = 'text/x-scss'; // SCSS (Sass)
|
| 854 |
+
mimes.types['sass'] = 'text/x-sass'; // Sass
|
| 855 |
+
mimes.types['less'] = 'text/x-less'; // Less
|
| 856 |
+
mimes.types['coffee'] = 'text/coffeescript'; // CoffeeScript
|
| 857 |
+
mimes.types['dart'] = 'application/dart'; // Dart
|
| 858 |
+
mimes.types['sql'] = 'application/sql'; // SQL
|
| 859 |
+
mimes.types['vb'] = 'text/x-vbscript'; // VBScript
|
| 860 |
+
mimes.types['vbs'] = 'text/x-vbscript'; // VBScript (alternatif)
|
| 861 |
+
mimes.types['bat'] = 'application/x-msdos-program'; // Batch script
|
| 862 |
+
mimes.types['cmd'] = 'application/cmd'; // Command script
|
| 863 |
+
mimes.types['ps1'] = 'application/x-powershell'; // PowerShell script
|
| 864 |
+
mimes.types['ini'] = 'text/plain'; // INI file
|
| 865 |
+
mimes.types['toml'] = 'application/toml'; // TOML
|
| 866 |
+
mimes.types['cfg'] = 'text/plain'; // Configuration file
|
| 867 |
+
mimes.types['conf'] = 'text/plain'; // Configuration file
|
| 868 |
+
mimes.types['properties'] = 'text/plain'; // Properties file
|
| 869 |
+
mimes.types['log'] = 'text/plain'; // Log file
|
| 870 |
+
mimes.types['yml'] = 'application/x-yaml'; // YAML file
|
| 871 |
+
mimes.types['rst'] = 'text/x-rst'; // reStructuredText
|
| 872 |
+
mimes.types['latex'] = 'application/x-latex'; // LaTeX
|
| 873 |
+
mimes.types['tex'] = 'application/x-tex'; // TeX
|
| 874 |
+
mimes.types['bib'] = 'text/x-bibtex'; // BibTeX
|
| 875 |
+
mimes.types['mat'] = 'application/x-matlab-data'; // MATLAB
|
| 876 |
+
mimes.types['m'] = 'text/x-matlab'; // MATLAB or Objective-C
|
| 877 |
+
mimes.types['octave'] = 'text/x-octave'; // GNU Octave
|
| 878 |
+
mimes.types['rmd'] = 'text/x-r-markdown'; // R Markdown
|
| 879 |
+
mimes.types['jl'] = 'text/x-julia'; // Julia
|
| 880 |
+
mimes.types['clj'] = 'text/x-clojure'; // Clojure
|
| 881 |
+
mimes.types['cljs'] = 'text/x-clojurescript'; // ClojureScript
|
| 882 |
+
mimes.types['cljc'] = 'text/x-clojure'; // Clojure (Common)
|
| 883 |
+
mimes.types['erl'] = 'text/x-erlang'; // Erlang
|
| 884 |
+
mimes.types['hs'] = 'text/x-haskell'; // Haskell
|
| 885 |
+
mimes.types['lhs'] = 'text/x-literate-haskell'; // Literate Haskell
|
| 886 |
+
mimes.types['ml'] = 'text/x-ocaml'; // OCaml
|
| 887 |
+
mimes.types['mli'] = 'text/x-ocaml'; // OCaml Interface
|
| 888 |
+
mimes.types['fs'] = 'text/x-fsharp'; // F#
|
| 889 |
+
mimes.types['fsi'] = 'text/x-fsharp'; // F# Interactive
|
| 890 |
+
mimes.types['fsx'] = 'text/x-fsharp'; // F# Script
|
| 891 |
+
mimes.types['fsscript'] = 'text/x-fsharp'; // F# Script (alternative)
|
| 892 |
+
mimes.types['elm'] = 'text/x-elm'; // Elm
|
| 893 |
+
mimes.types['elm'] = 'application/elm'; // Elm (alternative)
|
| 894 |
+
mimes.types['ex'] = 'text/x-elixir'; // Elixir
|
| 895 |
+
mimes.types['exs'] = 'text/x-elixir'; // Elixir Script
|
| 896 |
+
mimes.types['eex'] = 'text/x-eex'; // Elixir Embedded Templates
|
| 897 |
+
mimes.types['html.eex'] = 'text/x-html-elixir'; // Elixir HTML Embedded Templates
|
| 898 |
+
mimes.types['hx'] = 'text/x-haxe'; // Haxe
|
| 899 |
+
mimes.types['hxml'] = 'application/hxml'; // Haxe XML
|
| 900 |
+
mimes.types['sml'] = 'text/x-sml'; // Standard ML
|
| 901 |
+
mimes.types['thy'] = 'text/x-isabelle-theory'; // Isabelle Theory
|
| 902 |
+
mimes.types['lean'] = 'text/x-lean'; // Lean
|
| 903 |
+
mimes.types['v'] = 'text/x-verilog'; // Verilog
|
| 904 |
+
mimes.types['sv'] = 'text/x-systemverilog'; // SystemVerilog
|
| 905 |
+
mimes.types['vhd'] = 'text/x-vhdl'; // VHDL
|
| 906 |
+
mimes.types['vhdl'] = 'text/x-vhdl'; // VHDL (alternative)
|
| 907 |
+
mimes.types['scm'] = 'text/x-scheme'; // Scheme
|
| 908 |
+
mimes.types['ss'] = 'text/x-scheme'; // Scheme (alternative)
|
| 909 |
+
mimes.types['rkt'] = 'text/x-racket'; // Racket
|
| 910 |
+
mimes.types['lisp'] = 'text/x-common-lisp'; // Common Lisp
|
| 911 |
+
mimes.types['asd'] = 'text/x-common-lisp'; // Common Lisp ASDF
|
| 912 |
+
mimes.types['cl'] = 'text/x-common-lisp'; // Common Lisp (alternative)
|
| 913 |
+
mimes.types['el'] = 'text/x-emacs-lisp'; // Emacs Lisp
|
| 914 |
+
mimes.types['sc'] = 'text/x-supercollider'; // SuperCollider
|
| 915 |
+
mimes.types['f'] = 'text/x-fortran'; // Fortran
|
| 916 |
+
mimes.types['f90'] = 'text/x-fortran'; // Fortran (alternative)
|
| 917 |
+
mimes.types['f95'] = 'text/x-fortran'; // Fortran (alternative)
|
| 918 |
+
mimes.types['v'] = 'text/x-vim'; // Vim Script
|
| 919 |
+
mimes.types['pro'] = 'text/x-prolog'; // Prolog
|
| 920 |
+
mimes.types['pl'] = 'text/x-prolog'; // Prolog (alternative to Perl)
|
| 921 |
+
mimes.types['p'] = 'text/x-pascal'; // Pascal
|
| 922 |
+
mimes.types['pas'] = 'text/x-pascal'; // Pascal (alternative)
|
| 923 |
+
mimes.types['d'] = 'text/x-d'; // D
|
| 924 |
+
mimes.types['ada'] = 'text/x-ada'; // Ada
|
| 925 |
+
mimes.types['adb'] = 'text/x-ada'; // Ada Body
|
| 926 |
+
mimes.types['ads'] = 'text/x-ada'; // Ada Specification
|
| 927 |
+
mimes.types['nim'] = 'text/x-nim'; // Nim
|
| 928 |
+
mimes.types['nimble'] = 'text/x-nim'; // Nimble
|
| 929 |
+
mimes.types['cr'] = 'text/x-crystal'; // Crystal
|
| 930 |
+
mimes.types['cl'] = 'text/x-clarion'; // Clarion
|
| 931 |
+
mimes.types['prg'] = 'text/x-clarion'; // Clarion Program
|
| 932 |
+
mimes.types['l'] = 'text/x-lex'; // Lex/Flex
|
| 933 |
+
mimes.types['yy'] = 'text/x-bison'; // Bison/Yacc
|
| 934 |
+
mimes.types['bison'] = 'text/x-bison'; // Bison/Yacc (alternative)
|
| 935 |
+
mimes.types['mly'] = 'text/x-menhir'; // Menhir
|
| 936 |
let {fileTypeFromBuffer} = await (await import('file-type'))
|
| 937 |
return res.json({
|
| 938 |
message:"Success",
|