generated from azures04/Base-REST-API
Moved download and gamefiles routes to api/v2 directory and updated service imports. Added a new api/v2/status endpoint to report maintenance status. Introduced api/v1/file route to return 410 error for deprecated launcher support.
10 lines
365 B
JavaScript
10 lines
365 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 |