Files
notifications-admin/urls.js

63 lines
2.1 KiB
JavaScript
Raw Normal View History

2025-06-18 12:36:12 -04:00
const baseUrl = process.env.BACKSTOP_BASE_URL || 'http://localhost:6012';
2024-09-18 13:59:16 -04:00
2025-06-18 12:36:12 -04:00
// List of routes organized by section
const routes = {
// Main pages
main: [
{ label: 'Homepage', path: '/' },
{ label: 'Add Service', path: '/add-service' },
{ label: 'Support', path: '/support' },
{ label: 'Notify.gov Service Ending', path: '/notify-service-ending' },
{ label: 'Notify.gov Sign In', path: '/sign-in' },
],
// Using Notify section
usingNotify: [
{ label: 'Get Started', path: '/using-notify/get-started' },
{ label: 'Trial Mode', path: '/using-notify/trial-mode' },
{ label: 'Pricing', path: '/using-notify/pricing' },
{ label: 'Delivery Status', path: '/using-notify/delivery-status' },
{ label: 'How To', path: '/using-notify/how-to' },
{ label: 'Best Practices', path: '/using-notify/best-practices' },
],
// Best Practices subsection
bestPractices: [
{ label: 'Clear Goals', path: '/using-notify/best-practices/clear-goals' },
{ label: 'Rules And Regulations', path: '/using-notify/best-practices/rules-and-regulations' },
{ label: 'Establish Trust', path: '/using-notify/best-practices/establish-trust' },
{ label: 'Write For Action', path: '/using-notify/best-practices/write-for-action' },
{ label: 'Multiple Languages', path: '/using-notify/best-practices/multiple-languages' },
{ label: 'Benchmark Performance', path: '/using-notify/best-practices/benchmark-performance' },
],
// About section
about: [
{ label: 'About', path: '/about' },
{ label: 'Why Text Messaging', path: '/about/why-text-messaging' },
{ label: 'Security', path: '/about/security' },
],
};
// Flatten all routes into a single array
2024-09-18 13:59:16 -04:00
const sublinks = [
2025-06-18 12:36:12 -04:00
...routes.main,
...routes.usingNotify,
...routes.bestPractices,
...routes.about,
// Add more sections here as needed
2024-09-18 13:59:16 -04:00
];
const createFullUrl = (base, path) => `${base}${path}`;
// Build url using base and path
const constructUrls = (base, sublinks) =>
sublinks.reduce((acc, { label, path }) => {
return { ...acc, [label]: createFullUrl(base, path) };
}, {});
module.exports = {
2024-09-23 13:07:24 -04:00
baseUrl,
2024-09-18 13:59:16 -04:00
urls: constructUrls(baseUrl, sublinks),
};