generated from azures04/Base-REST-API
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.
10 lines
359 B
JavaScript
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 |