-
Notifications
You must be signed in to change notification settings - Fork 0
/
mginx.js
3 lines (3 loc) · 11.5 KB
/
mginx.js
1
2
3
(process.argv[2]||console.error('No port specified in argument'))&&((()=>{const z='message',y='writeHead',t='existsSync',x=JSON.stringify,w=process.cwd(),v='pathname',h=require('http'),fs=require('fs'),{join:k,extname}=require('path/posix'),dbg=process.argv.includes('--debug')?console.log:()=>{},g={},j=JSON.parse(require('zlib').gunzipSync(Buffer.from(
'H4sIAAAAAAAACrV92ZLkKpLov9RrH6m7MqtPdd9fuTY2hiQkkSEkEtASOTb_Pr6gJQKPuud0zzVLEwpwEIvvOOR_fVPODaZW0UzjX5exKYcpzqH4XrwV79_-z__99v3t_dt__PYt6i1SsRnfm_K9sQMWUgqli2n09Nf3zrk3yu7eMNdY1em_qsW0mEnpb5QELL1-dytu3kSFYDevAOrmv84Wem1qLIIUW6CfDx_lbzpqdW5M3pMz9wr60IGfX0U9Wed1CLpBqJ9fz0BTHXUsQvRaWRoRdKYyIz7dDZ6NdsN0xxcTYkq-MLUdPQM-Z-sg0UMNTxMmeA49NjR4HNvw1cMTc6fqA57uhlUBLOuvmmM_-VV5XWAfsDuqAtj5_Q2ey7TBc3u_rMNWmHoMCEjpMStK1Vwbe2TdD3z-UL_8oFWOq9hfggXdMZiw3qoy6-RpolW1PpcjoimrPfwem_uorKlDqWruaF0LzdX6afkgR2y1nuupmgYGmV-CeJcgIk6LivVlwhpX8_o3GR5RfYTqvHI9AWkB2dppjEW8O_2dQFqLS90qelb0zGaWaK-ypZ2aOk1_i5g0AJK9_-Ptb-kVM59quinEUHvjItUyiH4OcdFdsACm0LRMp0ympq05acUxNlOlS2V8cSkpzAgdGAbtC6fqGyDdX74Md9V4eYlNp_BJMJBIMGPjJ9OUqcVC-bo3i6YaQHXZ1Npw7RKDnT-FDzC_g1w_qZqXzGW9dZ0rgulGFWfP3w44PZB1ciL-duBJDDSJYTt4J0xwYKwJuNoZSTDm1TDMMhjrhnupgOwJPqN-FSf7l41ZML5L5f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jHN75YEjJnNC5YFPwbVnsRxiuwfsbPPZ0vwQtrXhPWPTSv-wAUtX4oWX6zG3O0k9TIQPfH2pr6-y0fVxbR5kPAOm-1MwydYPMp92jAWwPwRE3Zm5D3TfMzzFPuO1WL0emoKOOONmFa7t0X9rr_NDPLJoON6peYx3CtN4BxufvBeYXIpqNWIkgieSw0Qo4zs9H-sl119NOInJpYx8fcDY-fI13-b1bm9_xzJM8rKGFKJbU1_LwHDEm0kKy72xj70ZzQ2-OPJ1I6N--OI03K2jmGyO933sj0OPNCYcjUIX4qaomuOGMpB6heejfF491lajgrGauki-IUx---bXN3pe4pnbgf-vB6XPSxN4-sPj9Kcidkg-9jqYzqpie2dpBcl__Pf_AOOSiXo6ZgAA'
,'base64')).toString()),r=(c,d)=>c.end(`<a href="${k(d[v],'..')}"><=</a> <a id="header">${d[v]}:</a><br>${fs.readdirSync(k(w,d[v]),{withFileTypes:!0}).sort((i,r)=>r.isDirectory()-i.isDirectory()).map(i=>'<a id="a" href="'+k('/',d[v].substr(1),i.name)+'">'+i.name.padEnd(30," ")+" | "+(i.isDirectory()?fs[t](k(w,d[v],i.name,'index.html'))?"Website":"Folder":"File")+'</a><br>').join("")}<hr><a id="footer">mginx</a><style>#footer{font-size:smaller;}#header{font-weight:bold;}#a{white-space:break-spaces;font-family:monospace}*{text-decoration:none}</style>`);h.createServer(async(b,c)=>{let d=new URL(b.url,`http://${b.headers.host}`);if(d[v].startsWith("/_api")){var e=k(w,d[v],"index.js");e=fs.existsSync(e)?e:k(w,d[v]);try{let a=await require(e)(d,c);try{c.end(x(a))}catch(e){dbg(e)}}catch(a){c.writeHead(500),a.g&&(a.g=d[v]),c.end(x(a))}}else{b=k(w,d[v]);try{e=fs.createReadStream(b),g.c=Object.entries(j).find(e=>e[1].includes(extname(b).substr(1))),g.c&&c.setHeader('Content-Type',g.c[0]),e.on("error",a=>{a[z].includes("ENOENT")?d[v].endsWith('/index.html')?r(c,{[v]:'/'}):c[y](404):a[z].includes("EPERM")?c[y](403):a[z].includes("EISDIR")?(fs[t](g.a=k(w,d[v],'index.html'))?c[y](301,{Location:k(d[v],'index.html')}):r(c,d)):c[y](500);a.path&&(a.path=d[v]);c.end(x(a)).on('error',dbg)}),e.pipe(c)}catch(e){dbg(e)}}}).listen(arg=parseInt(process.argv[2])).on('listening',()=>console.log("Listening on port "+arg)).on('error',dbg)})()*(()=>{r=require('node:module').createRequire(__filename);require=r;})())