✨ feat(helper): add screenshot helper function
- introduce a new screenshot helper function for path resolution - enhance code readability by organizing screenshot path management
This commit is contained in:
parent
370e3db206
commit
866f06e505
1 changed files with 4 additions and 0 deletions
|
|
@ -20,6 +20,10 @@ const URL_CLAIM = 'https://store.epicgames.com/en-US/free-games';
|
||||||
const COOKIES_PATH = path.resolve(cfg.dir.browser, 'epic-cookies.json');
|
const COOKIES_PATH = path.resolve(cfg.dir.browser, 'epic-cookies.json');
|
||||||
const BEARER_TOKEN_NAME = 'EPIC_BEARER_TOKEN';
|
const BEARER_TOKEN_NAME = 'EPIC_BEARER_TOKEN';
|
||||||
|
|
||||||
|
// Screenshot Helper Function
|
||||||
|
const screenshot = (...a) => path.resolve(cfg.dir.screenshots, 'epic-games', ...a);
|
||||||
|
|
||||||
|
|
||||||
// Fetch Free Games from API
|
// Fetch Free Games from API
|
||||||
const fetchFreeGamesAPI = async () => {
|
const fetchFreeGamesAPI = async () => {
|
||||||
const resp = await axios.get('https://store-site-backend-static-ipv4.ak.epicgames.com/freeGamesPromotions', {
|
const resp = await axios.get('https://store-site-backend-static-ipv4.ak.epicgames.com/freeGamesPromotions', {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue