UNPKG

aa-daily-reflections

Version:

A lightweight Node.js library to fetch Daily Reflections from Alcoholics Anonymous (AA)

12 lines (11 loc) 476 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildApiUrl = buildApiUrl; const date_1 = require("../utils/date"); function buildApiUrl(month, day, language) { const baseUrl = 'https://www.aa.org'; const monthStr = (0, date_1.padNumber)(month); const dayStr = (0, date_1.padNumber)(day); const langPath = language === 'en' ? '' : `/${language}`; return `${baseUrl}${langPath}/api/reflections/${monthStr}/${dayStr}`; }