17 lines
435 B
TypeScript
17 lines
435 B
TypeScript
import { Router } from 'express'
|
|
import { TwitchAPI } from '../util/scraping/extractor/index'
|
|
|
|
const profileRouter = Router()
|
|
const twitch = new TwitchAPI()
|
|
|
|
profileRouter.get('/users/:username', async (req, res, next) => {
|
|
const username = req.params.username
|
|
|
|
let streamerData = await twitch.getStreamerInfo(username)
|
|
.catch(next)
|
|
|
|
if (streamerData)
|
|
res.send(streamerData)
|
|
})
|
|
|
|
export default profileRouter |