mirror of
https://github.com/KevinMidboe/fetch-the-release.git
synced 2025-10-29 09:30:24 +00:00
Changed env url variable name
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
BASE_PATH=
|
BASE_URL=
|
||||||
AUTHORIZATION=
|
AUTHORIZATION=
|
||||||
USER=
|
USER=
|
||||||
PASS=
|
PASS=
|
||||||
|
|||||||
6
index.js
6
index.js
@@ -2,7 +2,7 @@ require('dotenv').config()
|
|||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
const { whoAmI, printAll, writeCache, readCache } = require('./utils')
|
const { whoAmI, printAll, writeCache, readCache } = require('./utils')
|
||||||
|
|
||||||
const BASE_PATH = process.env.BASE_PATH
|
const BASE_URL = process.env.BASE_URL
|
||||||
|
|
||||||
const mapResult = (result) => {
|
const mapResult = (result) => {
|
||||||
return {
|
return {
|
||||||
@@ -20,7 +20,7 @@ const undownloaded = (media) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fetchRequestMedia() {
|
function fetchRequestMedia() {
|
||||||
return fetch(`${BASE_PATH}/v2/request?page=1`)
|
return fetch(`${BASE_URL}/v2/request?page=1`)
|
||||||
.then(resp => resp.json())
|
.then(resp => resp.json())
|
||||||
.then(result => {
|
.then(result => {
|
||||||
const { results, total_results } = {...result}
|
const { results, total_results } = {...result}
|
||||||
@@ -32,7 +32,7 @@ function fetchRequestMedia() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fetchReleases(media) {
|
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, {
|
return fetch(url, {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': process.env.AUTHORIZATION
|
'Authorization': process.env.AUTHORIZATION
|
||||||
|
|||||||
Reference in New Issue
Block a user