aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/middleware/urlexpand.js
blob: fd7ab3bba75a7d1d7358faaadbee9101c14357af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { expandShortenedLink } from '../../src/api'

/**
 * Expand URLs
 * @type {import('express').RequestParamHandler}
 */
export default function urlExpand(req, res) {
    let url = (req.query.url || '').toString()
    return expandShortenedLink(url).then(result => {
        res.json(result)
    })
}