-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa5c39c
commit d9ce454
Showing
4 changed files
with
11,080 additions
and
2,492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const axios = require('axios'); | ||
require('dotenv').config(); | ||
|
||
// Function to get apps from Heroku | ||
const getHerokuApps = async () => { | ||
try { | ||
const herokuToken = process.env.HEROKU_API_TOKEN; | ||
|
||
const response = await axios.get('https://api.heroku.com/apps', { | ||
headers: { | ||
Authorization: `Bearer ${herokuToken}`, | ||
Accept: 'application/vnd.heroku+json; version=3', | ||
}, | ||
}); | ||
|
||
return response.data; | ||
} catch (error) { | ||
console.error('Error fetching apps from Heroku:', error); | ||
throw error; | ||
} | ||
}; | ||
|
||
module.exports = { | ||
getHerokuApps, | ||
}; |
Oops, something went wrong.