diff --git a/app.js b/app.js index f0bdb96..012bcda 100644 --- a/app.js +++ b/app.js @@ -109,14 +109,16 @@ app.options('/*', (req, res) => { }); // GET request -app.get(/\/([a-z0-9\-]+)\/([a-z0-9\-,]+\.(js|json|svg))?$/, (req, res) => { - let collection = cdn.findCollection(req.params[0]), - result; - - if (collection === null) { +app.get(/\/([a-z0-9\-\/]+)\.(js|json|svg)$/, (req, res) => { + let parts = req.params[0].split('/'), result = 404; - } else { - result = cdn.parser(collection, req.params[1], req.query); + + if (parts.length) { + let collection = cdn.getCollection(parts[0]); + + if (collection !== null) { + result = cdn.parseQuery(collection, parts, req.params[1], req.query); + } } if (typeof result === 'number') { diff --git a/package.json b/package.json index fad85bc..5c1bd41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-svg-website-icons", - "version": "0.0.7", + "version": "0.1.0", "description": "Node.js version of icons.simplesvg.com", "main": "app.js", "scripts": { @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "express": "^4.16.2", - "simple-svg-cdn": "^0.2.2", + "simple-svg-cdn": "^0.3.1", "simple-svg-icons": "git+https://github.com/simplesvg/icons.git" } }