removed unused code
This commit is contained in:
parent
be5117feca
commit
5e5a584042
2 changed files with 0 additions and 3 deletions
|
@ -7,11 +7,9 @@ export class DnsService {
|
|||
private lookup = util.promisify(dns.lookup);
|
||||
|
||||
async isValidUrl(url: string): Promise<boolean> {
|
||||
console.log('HERE!!!')
|
||||
try {
|
||||
const hostname = new URL(url).hostname;
|
||||
await this.lookup(hostname);
|
||||
console.log('HERE!')
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
|
|
|
@ -7,7 +7,6 @@ export class UrlShortenerController {
|
|||
|
||||
@Post('shorten')
|
||||
async shortenUrl(@Body('url') url: string): Promise<{ shortUrl: string }> {
|
||||
// example route http://localhost:3000/url-shortener/shorten POST body { url: 'https://www.google.com' }
|
||||
if (!url) {
|
||||
throw new HttpException('URL is required', HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue