fleet/website/config/routes.js
eashaw c4bc41ad4f
Add page titles and descriptions to fleetdm.com (#2082)
* added title to locals in routes

* using title and description if they are passed into the locals

* fix error being thrown if there is no description

* descriptions

* fixed error, updated descriptions

* update twitter card title

* updated descriptions again

* updated twitter title
2021-09-16 16:23:59 +09:00

168 lines
7.9 KiB
JavaScript
Vendored

/**
* Route Mappings
* (sails.config.routes)
*
* Your routes tell Sails what to do each time it receives a request.
*
* For more information on configuring custom routes, check out:
* https://sailsjs.com/anatomy/config/routes-js
*/
module.exports.routes = {
// ╦ ╦╔═╗╔╗ ╔═╗╔═╗╔═╗╔═╗╔═╗
// ║║║║╣ ╠╩╗╠═╝╠═╣║ ╦║╣ ╚═╗
// ╚╩╝╚═╝╚═╝╩ ╩ ╩╚═╝╚═╝╚═╝
'GET /': {
action: 'view-homepage-or-redirect',
locals: { isHomepage: true }
},
'GET /company/contact': {
action: 'view-contact',
locals:{
title: 'Contact us | Fleet for osquery',
description: 'Get in touch with our team.'
}
},
'GET /get-started': {
action: 'view-get-started' ,
locals:{
title: 'Get Started | Fleet for osquery',
description: 'Learn about getting started with Fleet.'
}
},
'GET /pricing': {
action: 'view-pricing',
locals:{
title: 'Pricing | Fleet for osquery',
description: 'View Fleet plans and pricing details.'
}
},
'GET /press-kit': {
action: 'view-press-kit',
locals:{
title: 'Press kit | Fleet for osquery',
description: 'Download Fleet logos, wallpapers, and screenshots.'
}
},
'GET /queries': {
action: 'view-query-library',
locals:{
title: 'Queries | Fleet for osquery',
description: 'A growing collection of useful queries for organizations deploying Fleet and osquery.'
}
},
'GET /queries/:slug': {
action: 'view-query-detail',
locals:{
title: 'Query details | Fleet for osquery',
description: 'View more information about a query in Fleet\'s standard query library',
}
},
'GET /docs/?*': {
skipAssets: false,
action: 'docs/view-basic-documentation',
locals:{
title: 'Documentation | Fleet for osquery',
description: 'Documentation for Fleet for osquery.',
}
},// handles /docs and /docs/foo/bar
// 'GET /handbook/?*': { skipAssets: false, action: 'handbook/view-basic-handbook' },// handles /handbook and /handbook/foo/bar
'GET /transparency': {
action: 'view-transparency',
locals:{
title: 'Transparency | Fleet for osquery',
description: 'Learn what data osquery can see.',
}
},
// ╦ ╔═╗╔═╗╔═╗╔═╗╦ ╦ ╦═╗╔═╗╔╦╗╦╦═╗╔═╗╔═╗╔╦╗╔═╗
// ║ ║╣ ║ ╦╠═╣║ ╚╦╝ ╠╦╝║╣ ║║║╠╦╝║╣ ║ ║ ╚═╗
// ╩═╝╚═╝╚═╝╩ ╩╚═╝ ╩ ╩╚═╚═╝═╩╝╩╩╚═╚═╝╚═╝ ╩ ╚═╝
// ┌─ ┌─┐┌─┐┬─┐ ┌┐ ┌─┐┌─┐┬┌─┬ ┬┌─┐┬─┐┌┬┐┌─┐ ┌─┐┌─┐┌┬┐┌─┐┌─┐┌┬┐ ─┐
// │ ├┤ │ │├┬┘ ├┴┐├─┤│ ├┴┐│││├─┤├┬┘ ││└─┐ │ │ ││││├─┘├─┤ │ │
// └─ └ └─┘┴└─ └─┘┴ ┴└─┘┴ ┴└┴┘┴ ┴┴└──┴┘└─┘ └─┘└─┘┴ ┴┴ ┴ ┴ ┴o ─┘
// Add redirects here for deprecated/legacy links, so that they go to an appropriate new place instead of just being broken when pages move or get renamed.
//
// For example:
// If we were going to change fleetdm.com/company/about to fleetdm.com/company/story, we might do something like:
// ```
// 'GET /company/about': '/company/story',
// ```
//
// Or another example, if we were to rename a doc page:
// ```
// 'GET /docs/using-fleet/learn-how-to-use-fleet': '/docs/using-fleet/fleet-for-beginners',
// ```
'GET /try-fleet': '/get-started',
// ╔╦╗╦╔═╗╔═╗ ╦═╗╔═╗╔╦╗╦╦═╗╔═╗╔═╗╔╦╗╔═╗ ┬ ╔╦╗╔═╗╦ ╦╔╗╔╦ ╔═╗╔═╗╔╦╗╔═╗
// ║║║║╚═╗║ ╠╦╝║╣ ║║║╠╦╝║╣ ║ ║ ╚═╗ ┌┼─ ║║║ ║║║║║║║║ ║ ║╠═╣ ║║╚═╗
// ╩ ╩╩╚═╝╚═╝ ╩╚═╚═╝═╩╝╩╩╚═╚═╝╚═╝ ╩ ╚═╝ └┘ ═╩╝╚═╝╚╩╝╝╚╝╩═╝╚═╝╩ ╩═╩╝╚═╝
// Convenience
// =============================================================================================================
// Things that people are used to typing in to the URL and just randomly trying.
//
// For example, a clever user might try to visit fleetdm.com/documentation, not knowing that Fleet's website
// puts this kind of thing under /docs, NOT /documentation. These "convenience" redirects are to help them out.
'GET /documentation': '/docs',
'GET /contribute': '/docs/contribute',
'GET /install': '/get-started',
'GET /company': '/company/about',
'GET /company/about': '/handbook', // FUTURE: brief "about" page explaining the origins of the company
'GET /support': '/company/contact',
'GET /contact': '/company/contact',
'GET /legal': '/legal/terms',
'GET /terms': '/legal/terms',
// Sitemap
// =============================================================================================================
// This is for search engines, not humans. Search engines know to visit fleetdm.com/sitemap.xml to download this
// XML file, which helps search engines know which pages are available on the website.
'GET /sitemap.xml': { action: 'download-sitemap' },
// Potential future pages
// =============================================================================================================
// Things that are not webpages here (in the Sails app) yet, but could be in the future. For now they are just
// redirects to somewhere else EXTERNAL to the Sails app.
'GET /security': 'https://github.com/fleetdm/fleet/security/policy',
'GET /brand': '/contact',// FUTURE: a page like sailsjs.com/logos
'GET /blog': 'https://blog.fleetdm.com',// Currently, Fleet's blog lives outside of this website source code (the Sails app). We always link to fleetdm.com/blog, but since the blog lives elsewhere, we redirect to it.
'GET /hall-of-fame': 'https://github.com/fleetdm/fleet/pulse',
'GET /apply': 'https://fleet-device-management.breezy.hr',
'GET /handbook': 'https://github.com/fleetdm/fleet/tree/main/handbook',// TODO: Bring back the above when styles are ready
'GET /company/stewardship': 'https://github.com/fleetdm/fleet', // FUTURE: page about how we approach open source and our commitments to the community
'GET /legal/terms': 'https://docs.google.com/document/d/1OM6YDVIs7bP8wg6iA3VG13X086r64tWDqBSRudG4a0Y/edit',
// ╦ ╦╔═╗╔╗ ╦ ╦╔═╗╔═╗╦╔═╔═╗
// ║║║║╣ ╠╩╗╠═╣║ ║║ ║╠╩╗╚═╗
// ╚╩╝╚═╝╚═╝╩ ╩╚═╝╚═╝╩ ╩╚═╝
'POST /api/v1/webhooks/receive-usage-analytics': { action: 'webhooks/receive-usage-analytics', csrf: false },
'/api/v1/webhooks/github': { action: 'webhooks/receive-from-github', csrf: false },
// ╔═╗╔═╗╦ ╔═╗╔╗╔╔╦╗╔═╗╔═╗╦╔╗╔╔╦╗╔═╗
// ╠═╣╠═╝║ ║╣ ║║║ ║║╠═╝║ ║║║║║ ║ ╚═╗
// ╩ ╩╩ ╩ ╚═╝╝╚╝═╩╝╩ ╚═╝╩╝╚╝ ╩ ╚═╝
// Note that, in this app, these API endpoints may be accessed using the `Cloud.*()` methods
// from the Parasails library, or by using those method names as the `action` in <ajax-form>.
'POST /api/v1/deliver-contact-form-message': { action: 'deliver-contact-form-message' },
};