generated from azures04/Base-REST-API
Changed BASE_POINT in .env.example and the download route in download.js to use '/api/v2/download/' instead of '/download/'. Updated .gitignore to exclude '/data/game' directory.
10 lines
372 B
JavaScript
10 lines
372 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("/api/v2/download/", ""))
|
|
return res.status(fileRequest.code).sendFile(fileRequest.path)
|
|
})
|
|
|
|
module.exports = router |