Add legacy skin and cape routes, improve error handling
Introduces legacy routes for Minecraft skins and capes to support older endpoints. Enhances error handling in sessionsRepository for missing skins/capes, adds getActiveSkin and getActiveCape to sessionsService, and improves error logging in server.js.
This commit is contained in:
10
routes/legacy/skins/[username].js
Normal file
10
routes/legacy/skins/[username].js
Normal file
@@ -0,0 +1,10 @@
|
||||
const express = require("express")
|
||||
const router = express.Router({ mergeParams: true })
|
||||
const sessionsService = require("../../../services/sessionsService")
|
||||
|
||||
router.get("", async (req, res) => {
|
||||
const cape = await sessionsService.getActiveSkin({ username: req.params.username.replace(".png", "") })
|
||||
return res.redirect(`/textures${cape.data.url}`)
|
||||
})
|
||||
|
||||
module.exports = router
|
||||
Reference in New Issue
Block a user