mirror of
https://github.com/Aviortheking/codestats-skyline.git
synced 2025-04-22 02:02:09 +00:00
fix: Error returned from Code::Stats
Signed-off-by: Avior <f.bouillon@aptatio.com>
This commit is contained in:
parent
9e81ea201d
commit
e27d42d37d
6
index.ts
6
index.ts
@ -21,6 +21,12 @@ app.get('/', async (req, res) => {
|
|||||||
// Generate the STL
|
// Generate the STL
|
||||||
const bfr = await generateThingy(username, yearN)
|
const bfr = await generateThingy(username, yearN)
|
||||||
|
|
||||||
|
if (!bfr) {
|
||||||
|
res.status(500)
|
||||||
|
.send('It seems the generator could not generate, Please open an issue on Github https://github.com/aviortheking/codestats-skyline/issues/new')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// force download the STL with a good name
|
// force download the STL with a good name
|
||||||
res
|
res
|
||||||
.setHeader('Content-Disposition', `attachment; filename=${username}-${year ? year : 'full'}.stl`)
|
.setHeader('Content-Disposition', `attachment; filename=${username}-${year ? year : 'full'}.stl`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user