LentiaServices/routes/api/v2/download.js
2026-01-25 22:16:08 +01:00

10 lines
376 B
JavaScript

const express = require("express")
const router = express.Router()
const gameFilesService = require("../../../services/gameDataService")
router.get(/.*/, async (req, res) => {
const fileRequest = await gameFilesService.getFile(req.originalUrl.replace("/api/v2/download/", ""))
return res.status(fileRequest.code).sendFile(fileRequest.path)
})
module.exports = router