UNPKG

md-toy-blog

Version:

Very simple Markdown blog: serves your md as html without fancy databases. You will only spend time writing the actual data.

22 lines (21 loc) 836 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RoutePathValidator = /** @class */ (function () { function RoutePathValidator(config) { this.config = config; this.paths = config.paths; this.controller = config.controller; } RoutePathValidator.prototype.canResolve = function (request) { return this.matches(request, this.paths) && this.isValid(request); }; RoutePathValidator.prototype.matches = function (req, paths) { var url = req.url, method = req.method; return paths.filter(function (path) { return method === 'GET' && url.indexOf(path) === 0; }).length > 0; }; RoutePathValidator.prototype.isValid = function (req) { return true; }; return RoutePathValidator; }()); exports.default = RoutePathValidator;