dsql-admin/dsql-app/.local_dist/server/pages/api/stream/[path].js

1 line
1.5 KiB
JavaScript
Raw Normal View History

2024-12-05 07:03:33 +00:00
"use strict";(()=>{var e={};e.id=5141,e.ids=[5141],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")},96762:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,n){return n in t?t[n]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,n)):"function"==typeof t&&"default"===n?t:void 0}}})},33921:(e,t,n)=>{n.r(t),n.d(t,{config:()=>P,default:()=>f,routeModule:()=>c});var r={};n.r(r),n.d(r,{default:()=>p});var i=n(89947),a=n(2706),o=n(96762),u=n(33873),s=n.n(u);let d=n(29021);async function p(e,t){if("GET"!==e.method)return t.json({msg:"Invalid Request"});let n=s().resolve(process.cwd(),"./public/videos"),r=e.query.name;if(!r||"string"!=typeof r){t.status(400).end("No video name provided");return}let i=s().join(n,r);if(!d.existsSync(i)){t.status(400).end("Video not found");return}d.statSync(i).size,e.headers.range,d.createReadStream(i).pipe(t)}let f=(0,o.M)(r,"default"),P=(0,o.M)(r,"config"),c=new i.PagesAPIRouteModule({definition:{kind:a.A.PAGES_API,page:"/api/stream/[path]",pathname:"/api/stream/[path]",bundlePath:"",filename:""},userland:r})},2706:(e,t)=>{var n;Object.defineProperty(t,"A",{enumerable:!0,get:function(){return n}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(n||(n={}))},89947:(e,t,n)=>{e.exports=n(75600)}};var t=require("../../../webpack-api-runtime.js");t.C(e);var n=t(t.s=33921);module.exports=n})();