LentiaServices/routes/download.js
azures04 cf54edf146 Refactor API for game file download and listing
Removed user registration and user info endpoints, along with related schemas, services, and tests. Added new routes and service for listing and downloading game files. Updated README to reflect new API purpose. Refactored logger and utils for improved modularity.
2026-01-25 21:39:44 +01:00

10 lines
359 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.baseUrl.replace("/download/", ""))
return res.status(fileRequest.code).sendFile(fileRequest.path)
})
module.exports = router