0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch.git synced 2025-01-31 00:29:01 -05:00
safetwitch/server/routes/profile/profileRoute.ts
2023-03-07 23:31:09 -05:00

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