Skip to content

Commit 630e1c5

Browse files
committed
Add sitemap
1 parent 61bee72 commit 630e1c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/backend/controllers/algorithms.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,14 @@ router.route('/:categoryKey/:algorithmKey')
128128
res.json({ algorithm: { categoryKey, categoryName, algorithmKey, algorithmName, files } });
129129
});
130130

131+
router.route('/sitemap.txt')
132+
.get((req, res, next) => {
133+
const urls = [];
134+
categories.forEach(category => category.algorithms.forEach(algorithm => {
135+
urls.push(`http://algorithm-visualizer.org/${category.key}/${algorithm.key}`);
136+
}));
137+
res.set('Content-Type', 'text/plain');
138+
res.send(urls.join('\n'));
139+
});
140+
131141
export default router;

0 commit comments

Comments
 (0)