mirror of
https://codeberg.org/SafeTwitch/safetwitch.git
synced 2025-01-31 00:29:01 -05:00
16 lines
No EOL
417 B
TypeScript
16 lines
No EOL
417 B
TypeScript
import { Router } from 'express'
|
|
import { TwitchScraper } from '../../util/scraping/extractors'
|
|
|
|
const profileRouter = Router()
|
|
const scraper = new TwitchScraper()
|
|
|
|
profileRouter.get('/users/:username', async (req, res, next) => {
|
|
const username = req.params.username
|
|
|
|
let streamerData = await scraper.getStreamerData(username)
|
|
.catch(next)
|
|
|
|
res.send(streamerData)
|
|
})
|
|
|
|
export default profileRouter |