Skip to content

Commit

Permalink
use /i/ prefix for images
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Apr 8, 2024
1 parent 4a44f56 commit e024de4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Take a screenshot of the current stream and send it to the chat.

```javascript
!foto
//result: https://external.url/images/cclj35.png
//result: https://external.url/i/cclj35.jpg
```

## Birthday
Expand Down
8 changes: 1 addition & 7 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@ mongoose.connect(config.database).then(() => {
app.use(express.static('public'))
app.use('/images', express.static('images'))

app.get('/status', function (req, res) {
res.redirect(config.statusUrl)
});

app.get('/:id', (req, res) => {
app.get('/i/:id', (req, res) => {
res.sendFile(__dirname + `/public/images/${req.params.id}.jpg`)
});



const listener = app.listen(process.env.PORT, ()=> {
console.log('Listening on port ', + listener.address().port)
app.get('/', (req, res) => res.send('Live!'))
Expand Down
2 changes: 1 addition & 1 deletion handlers/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Stream {
const image = await BrowserService.getScreenshot().catch(() => { console.error('getScreenshot on captureScreenshot')})
if (image) {

await bot.say(target, `Captura de ${displayName}: ${config.externalUrl}/${image.fileName}`)
await bot.say(target, `Captura de ${displayName}: ${config.externalUrl}/i/${image.fileName}`)
const channel = await TwitchService.getChannel()
await ScreenshotService.addScreenshot(image.fileName, channel.streamId, displayName, roomId)

Expand Down

0 comments on commit e024de4

Please sign in to comment.