mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-27 05:23:01 +00:00
22 lines
686 B
JavaScript
22 lines
686 B
JavaScript
const PathToRegexp = require('path-to-regexp');
|
|
|
|
const compilePath = (path, options) => {
|
|
const keys = [];
|
|
const regexp = PathToRegexp(path, keys, { ...options });
|
|
return { keys, regexp };
|
|
};
|
|
|
|
const routesRegexp = {
|
|
intro: compilePath('/intro'),
|
|
board: compilePath('/'),
|
|
discover: compilePath('/discover(?:/(:type|)(?:/(:catalog|))?)?'),
|
|
library: compilePath('/library(?:/(:type|)(?:/(:sort|))?)?'),
|
|
calendar: compilePath('/calendar'),
|
|
search: compilePath('/search'),
|
|
detail: compilePath('/detail'),
|
|
addons: compilePath('/addons'),
|
|
settings: compilePath('/settings'),
|
|
player: compilePath('/player')
|
|
};
|
|
|
|
module.exports = routesRegexp;
|