Changed env url variable name

This commit is contained in:
2019-07-23 23:51:55 +02:00
parent edf5cc1ee7
commit 7a87412f85
2 changed files with 4 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
BASE_PATH=
BASE_URL=
AUTHORIZATION=
USER=
PASS=

View File

@@ -2,7 +2,7 @@ require('dotenv').config()
const fetch = require('node-fetch')
const { whoAmI, printAll, writeCache, readCache } = require('./utils')
const BASE_PATH = process.env.BASE_PATH
const BASE_URL = process.env.BASE_URL
const mapResult = (result) => {
return {
@@ -20,7 +20,7 @@ const undownloaded = (media) => {
}
function fetchRequestMedia() {
return fetch(`${BASE_PATH}/v2/request?page=1`)
return fetch(`${BASE_URL}/v2/request?page=1`)
.then(resp => resp.json())
.then(result => {
const { results, total_results } = {...result}
@@ -32,7 +32,7 @@ function fetchRequestMedia() {
}
function fetchReleases(media) {
const url = encodeURI(`${BASE_PATH}/v1/pirate/search?query=${media.title}`)
const url = encodeURI(`${BASE_URL}/v1/pirate/search?query=${media.title}`)
return fetch(url, {
headers: {
'Authorization': process.env.AUTHORIZATION