mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 20:13:09 +02:00
Refactor: Improve readability
This commit is contained in:
parent
5ceb5b6a1f
commit
d69a6f0fb1
1 changed files with 4 additions and 4 deletions
|
@ -1,16 +1,16 @@
|
||||||
import * as url from 'url';
|
import * as URL from 'url';
|
||||||
import * as express from 'express';
|
import * as express from 'express';
|
||||||
import * as request from 'request';
|
import * as request from 'request';
|
||||||
|
|
||||||
module.exports = (req: express.Request, res: express.Response) => {
|
module.exports = (req: express.Request, res: express.Response) => {
|
||||||
const _url = req.params.url;
|
const url = req.params.url;
|
||||||
|
|
||||||
if (!_url) {
|
if (!url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
request({
|
request({
|
||||||
url: _url + (url.parse(req.url, true).search || ''),
|
url: url + (URL.parse(req.url, true).search || ''),
|
||||||
encoding: null
|
encoding: null
|
||||||
}, (err, response, content) => {
|
}, (err, response, content) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in a new issue