First public commit

This commit is contained in:
cyberalien 2017-05-05 18:29:10 +03:00
commit e1ef6f1f62
10 changed files with 498 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.idea
.elasticbeanstalk
node_modules
*.log
ssl/ssl.*

5
.npmignore Normal file
View File

@ -0,0 +1,5 @@
.idea
.git
node_modules
npm-debug.log
tests

151
app.js Normal file
View File

@ -0,0 +1,151 @@
/**
* Main file to run in Node.js
*
* Run ssl.js instead of you want SSL support.
*/
"use strict";
/*
* Configuration
*/
// True if server should include default icons set
const serveDefaultIcons = true;
// Directory with json files for custom icon sets
// Use simple-svg-tools package to create json collections
const customIconsDirectory = 'json';
// HTTP port
// Run ssl.js for SSL support
const port = process.env.PORT || 3000;
/*
* Main stuff
*/
const fs = require('fs'),
// Express stuff
express = require('express'),
compression = require('compression'),
app = express(),
// Debug stuff
version = JSON.parse(fs.readFileSync('package.json', 'utf8')).version,
// CDN stuff
cdn = require('simple-svg-cdn');
// Cache time
const cache = 3600; // cache time in seconds
const cacheMin = cache; // minimum cache refresh time in seconds
// Load default collections
if (serveDefaultIcons) {
const icons = require('simple-svg-icons');
Object.keys(icons.collections()).forEach(prefix => {
let filename = icons.locate(prefix),
data;
try {
data = fs.readFileSync(filename, 'utf8');
data = JSON.parse(data);
cdn.deOptimize(data);
} catch (err) {
console.log(err);
return;
}
console.log('Added premade collection: ' + prefix);
cdn.addCollection(prefix, data);
});
}
// Add collections from "json" directory
let files;
try {
files = fs.readdirSync(customIconsDirectory);
} catch (err) {
files = [];
}
files.forEach(file => {
let list = file.split('.');
if (list.length !== 2 || list[1] !== 'json') {
return;
}
try {
let data = fs.readFileSync(customIconsDirectory + '/' + file, 'utf8');
data = JSON.parse(data);
cdn.deOptimize(data);
console.log('Added custom collection: ' + list[0]);
cdn.addCollection(list[0], data);
} catch (err) {
}
});
// Sort collections
cdn.sortPrefixes();
// Disable X-Powered-By header and enable compression
app.disable('x-powered-by');
app.use(compression({
filter: (req, res) => true
}));
// CORS
app.options('/*', (req, res) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, OPTIONS');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding');
res.header('Access-Control-Max-Age', 86400);
res.send(200);
});
// 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) {
result = 404;
} else {
result = cdn.parser(collection, req.params[1], req.query);
}
if (typeof result === 'number') {
res.sendStatus(result);
return;
}
// Send cache header
if (
cache &&
(req.get('Pragma') === void 0 || req.get('Pragma').indexOf('no-cache') === -1) &&
(req.get('Cache-Control') === void 0 || req.get('Cache-Control').indexOf('no-cache') === -1)
) {
res.set('Cache-Control', 'public, max-age=' + cache + ', min-refresh=' + cacheMin);
}
// Send data
res.type(result.type).send(result.body);
});
// Debug information and AWS health check
app.get('/version', (req, res) => {
let body = 'SimpleSVG CDN version ' + version + ' (Node';
if (process.env.region) {
body += ', ' + process.env.region;
}
body += ')';
res.send(body);
});
// Redirect home page
app.get('/', (req, res) => {
res.redirect(301, 'https://simplesvg.com/');
});
// Create server
app.listen(port, () => {
console.log('Listening on port ' + port);
});
module.exports = app;

4
app.yaml Normal file
View File

@ -0,0 +1,4 @@
# [START runtime]
runtime: nodejs
env: flex
# [END runtime]

259
json/arty.json Normal file
View File

@ -0,0 +1,259 @@
{
"icons": {
"arty-stroke-16-arrow-left": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M120 64H16\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-153\"/><path d=\"M8 64l40 40\" stroke-linejoin=\"round\" data-shape-index=\"1\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-68\"/><path d=\"M8 64l40-40\" stroke-linejoin=\"round\" data-shape-index=\"2\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-68\"/></g>"
},
"arty-stroke-16-arrows-from-2-corners": {
"body": "<g stroke-linecap=\"round\" stroke=\"currentColor\" stroke-width=\"16\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M48 80H16\" stroke-linejoin=\"round\" data-shape-index=\"0\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M48 80v32\" stroke-linejoin=\"round\" data-shape-index=\"1\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M80 48V16\" stroke-linejoin=\"round\" data-shape-index=\"2\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M80 48h32\" stroke-linejoin=\"round\" data-shape-index=\"3\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 120l36-36\" data-shape-index=\"4\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M120 8L84 44\" data-shape-index=\"5\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/></g>"
},
"arty-stroke-16-arrows-from-corners": {
"body": "<g stroke-linecap=\"round\" stroke=\"currentColor\" stroke-width=\"16\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M48 48V16\" data-shape-index=\"0\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M80 80v32\" data-shape-index=\"1\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M80 48V16\" data-shape-index=\"2\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M48 80v32\" data-shape-index=\"3\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M80 80h32\" data-shape-index=\"4\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M48 48H16\" data-shape-index=\"5\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M48 80H16\" data-shape-index=\"6\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M80 48h32\" data-shape-index=\"7\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 120l36-36\" data-shape-index=\"8\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M120 8L84 44\" data-shape-index=\"9\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M120 120L84 84\" data-shape-index=\"10\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M8 8l36 36\" data-shape-index=\"11\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/></g>"
},
"arty-stroke-16-arrows-horizontal": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M56 88h56\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M72 40H16\" data-shape-index=\"1\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M120 88L96 64\" stroke-linejoin=\"round\" data-shape-index=\"2\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M120 88l-24 24\" stroke-linejoin=\"round\" data-shape-index=\"3\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 40l24-24\" stroke-linejoin=\"round\" data-shape-index=\"4\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 40l24 24\" stroke-linejoin=\"round\" data-shape-index=\"5\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/></g>"
},
"arty-stroke-16-arrows-to-2-corners": {
"body": "<g stroke-linecap=\"round\" stroke-width=\"16\" stroke=\"currentColor\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M8 120V88\" stroke-linejoin=\"round\" data-shape-index=\"0\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 120h32\" stroke-linejoin=\"round\" data-shape-index=\"1\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M120 8H88\" stroke-linejoin=\"round\" data-shape-index=\"2\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M120 8v32\" stroke-linejoin=\"round\" data-shape-index=\"3\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M52 76l-36 36\" data-shape-index=\"4\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M76 52l36-36\" data-shape-index=\"5\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/></g>"
},
"arty-stroke-16-arrows-to-corners": {
"body": "<g stroke-linecap=\"round\" stroke=\"currentColor\" stroke-width=\"16\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M8 120V88\" data-shape-index=\"0\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M120 8v32\" data-shape-index=\"1\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M120 120V88\" data-shape-index=\"2\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 8v32\" data-shape-index=\"3\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 120h32\" data-shape-index=\"4\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M120 8H88\" data-shape-index=\"5\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M120 120H88\" data-shape-index=\"6\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 8h32\" data-shape-index=\"7\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M48 80l-36 36\" data-shape-index=\"8\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M80 48l36-36\" data-shape-index=\"9\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M80 80l36 36\" data-shape-index=\"10\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M48 48L12 12\" data-shape-index=\"11\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/></g>"
},
"arty-stroke-16-caret-up-outline": {
"body": "<path d=\"M38 74l26-26 26 26z\" stroke-width=\"12\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-fill\"/>"
},
"arty-stroke-16-caret-up": {
"body": "<path d=\"M24 80l40-40 40 40z\" fill=\"currentColor\" fill-rule=\"evenodd\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-fill\"/>"
},
"arty-stroke-16-carets-vertical-outline": {
"body": "<g stroke-width=\"12\" stroke=\"currentColor\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\"><path d=\"M38 78l26 26 26-26z\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-fill\"/><path d=\"M38 50l26-26 26 26z\" data-shape-index=\"1\" class=\"animation-delay-0 animation-duration-10 animate-fill\"/></g>"
},
"arty-stroke-16-carets-vertical": {
"body": "<g fill=\"currentColor\" fill-rule=\"evenodd\"><path d=\"M24 72l40 40 40-40z\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-fill\"/><path d=\"M24 56l40-40 40 40z\" data-shape-index=\"1\" class=\"animation-delay-0 animation-duration-10 animate-fill\"/></g>"
},
"arty-stroke-16-chevron-left": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M40 64l48-48\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-stroke stroke-length-102\"/><path d=\"M40 64l48 48\" data-shape-index=\"1\" class=\"animation-delay-0 animation-duration-10 animate-stroke stroke-length-102\"/></g>"
},
"arty-stroke-16-close": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M8 8l112 112\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-6 animate-stroke stroke-length-230\"/><path d=\"M8 120L120 8\" data-shape-index=\"1\" class=\"animation-delay-6 animation-duration-6 animate-stroke stroke-length-230\"/></g>"
},
"arty-stroke-16-confirm": {
"body": "<path d=\"M8 64l48 48 64-96\" stroke-linecap=\"round\" stroke-width=\"16\" stroke=\"currentColor\" stroke-linejoin=\"round\" fill=\"none\" fill-rule=\"evenodd\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-stroke stroke-length-230\"/>"
},
"arty-stroke-16-double-arrow-horizontal": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M64 64h48\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M64 64H16\" data-shape-index=\"1\" class=\"animation-delay-0 animation-duration-8 animate-stroke stroke-length-68\"/><path d=\"M120 64L96 40\" stroke-linejoin=\"round\" data-shape-index=\"2\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M120 64L96 88\" stroke-linejoin=\"round\" data-shape-index=\"3\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 64l24-24\" stroke-linejoin=\"round\" data-shape-index=\"4\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/><path d=\"M8 64l24 24\" stroke-linejoin=\"round\" data-shape-index=\"5\" class=\"animation-delay-8 animation-duration-5 animate-stroke stroke-length-45\"/></g>"
},
"arty-stroke-16-drop-outline": {
"body": "<path d=\"M64 8S24 54 24 82c0 22 16 38 40 38s40-16 40-38c0-28-40-74-40-74z\" stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\" fill-rule=\"evenodd\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-stroke stroke-length-345\"/>"
},
"arty-stroke-16-drop": {
"body": "<g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M64 8S24 54 24 82c0 22 16 38 40 38s40-16 40-38c0-28-40-74-40-74z\" stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-9 animate-stroke stroke-length-345\"/><path d=\"M64 8S24 54 24 82c0 12.676 5.311 23.36 14.404 30.139l57.8-56.002C84.565 33.594 64 8 64 8z\" fill=\"currentColor\" data-shape-index=\"1\" class=\"animation-delay-9 animation-duration-4 animate-fill\"/></g>"
},
"arty-stroke-16-filters": {
"body": "<g stroke=\"currentColor\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M24 8v40\" stroke-width=\"16\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-3 animate-stroke stroke-length-45\"/><path d=\"M24 104v16\" stroke-width=\"16\" data-shape-index=\"1\" class=\"animation-delay-3 animation-duration-1 animate-stroke stroke-length-20\"/><path d=\"M12 76h24\" stroke-width=\"24\" data-shape-index=\"2\" class=\"animation-delay-4 animation-duration-2 animate-stroke stroke-length-30\"/><path d=\"M64 8v8\" stroke-width=\"16\" data-shape-index=\"3\" class=\"animation-delay-6 animation-duration-1 animate-stroke stroke-length-9\"/><path d=\"M64 72v48\" stroke-width=\"16\" data-shape-index=\"4\" class=\"animation-delay-6 animation-duration-3 animate-stroke stroke-length-68\"/><path d=\"M52 44h24\" stroke-width=\"24\" data-shape-index=\"5\" class=\"animation-delay-9 animation-duration-2 animate-stroke stroke-length-30\"/><path d=\"M104 8v48\" stroke-width=\"16\" data-shape-index=\"6\" class=\"animation-delay-11 animation-duration-3 animate-stroke stroke-length-68\"/><path d=\"M104 112v8\" stroke-width=\"16\" data-shape-index=\"7\" class=\"animation-delay-14 animation-duration-1 animate-stroke stroke-length-9\"/><path d=\"M92 84h24\" stroke-width=\"24\" data-shape-index=\"8\" class=\"animation-delay-15 animation-duration-2 animate-stroke stroke-length-30\"/></g>"
},
"arty-stroke-16-grid-3-outline": {
"body": "<g transform=\"translate(4 4)\" stroke=\"currentColor\" stroke-width=\"8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\" fill-rule=\"evenodd\"><circle cx=\"12\" cy=\"12\" r=\"12\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-2 animate-fill\"/><circle cx=\"60\" cy=\"12\" r=\"12\" data-shape-index=\"1\" class=\"animation-delay-2 animation-duration-2 animate-fill\"/><circle cx=\"108\" cy=\"12\" r=\"12\" data-shape-index=\"2\" class=\"animation-delay-4 animation-duration-2 animate-fill\"/><circle cx=\"12\" cy=\"60\" r=\"12\" data-shape-index=\"3\" class=\"animation-delay-6 animation-duration-2 animate-fill\"/><circle cx=\"60\" cy=\"60\" r=\"12\" data-shape-index=\"4\" class=\"animation-delay-7 animation-duration-2 animate-fill\"/><circle cx=\"108\" cy=\"60\" r=\"12\" data-shape-index=\"5\" class=\"animation-delay-9 animation-duration-2 animate-fill\"/><circle cx=\"12\" cy=\"108\" r=\"12\" data-shape-index=\"6\" class=\"animation-delay-11 animation-duration-2 animate-fill\"/><circle cx=\"60\" cy=\"108\" r=\"12\" data-shape-index=\"7\" class=\"animation-delay-13 animation-duration-2 animate-fill\"/><circle cx=\"108\" cy=\"108\" r=\"12\" data-shape-index=\"8\" class=\"animation-delay-15 animation-duration-2 animate-fill\"/></g>"
},
"arty-stroke-16-grid-3": {
"body": "<g fill=\"currentColor\" fill-rule=\"evenodd\"><circle cx=\"16\" cy=\"16\" r=\"16\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-2 animate-fill\"/><circle cx=\"64\" cy=\"16\" r=\"16\" data-shape-index=\"1\" class=\"animation-delay-2 animation-duration-2 animate-fill\"/><circle cx=\"112\" cy=\"16\" r=\"16\" data-shape-index=\"2\" class=\"animation-delay-4 animation-duration-2 animate-fill\"/><circle cx=\"16\" cy=\"64\" r=\"16\" data-shape-index=\"3\" class=\"animation-delay-6 animation-duration-2 animate-fill\"/><circle cx=\"64\" cy=\"64\" r=\"16\" data-shape-index=\"4\" class=\"animation-delay-7 animation-duration-2 animate-fill\"/><circle cx=\"112\" cy=\"64\" r=\"16\" data-shape-index=\"5\" class=\"animation-delay-9 animation-duration-2 animate-fill\"/><circle cx=\"16\" cy=\"112\" r=\"16\" data-shape-index=\"6\" class=\"animation-delay-11 animation-duration-2 animate-fill\"/><circle cx=\"64\" cy=\"112\" r=\"16\" data-shape-index=\"7\" class=\"animation-delay-13 animation-duration-2 animate-fill\"/><circle cx=\"112\" cy=\"112\" r=\"16\" data-shape-index=\"8\" class=\"animation-delay-15 animation-duration-2 animate-fill\"/></g>"
},
"arty-stroke-16-list-3-outline": {
"body": "<g transform=\"translate(4 4)\" stroke=\"currentColor\" stroke-width=\"8\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"12\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-3 animate-fill\"/><rect x=\"48\" width=\"72\" height=\"24\" rx=\"12\" data-shape-index=\"1\" class=\"animation-delay-3 animation-duration-3 animate-fill\"/><circle cx=\"12\" cy=\"60\" r=\"12\" data-shape-index=\"2\" class=\"animation-delay-5 animation-duration-3 animate-fill\"/><rect x=\"48\" y=\"48\" width=\"72\" height=\"24\" rx=\"12\" data-shape-index=\"3\" class=\"animation-delay-8 animation-duration-3 animate-fill\"/><circle cx=\"12\" cy=\"108\" r=\"12\" data-shape-index=\"4\" class=\"animation-delay-11 animation-duration-3 animate-fill\"/><rect x=\"48\" y=\"96\" width=\"72\" height=\"24\" rx=\"12\" data-shape-index=\"5\" class=\"animation-delay-13 animation-duration-3 animate-fill\"/></g>"
},
"arty-stroke-16-list-3": {
"body": "<g fill=\"none\" fill-rule=\"evenodd\"><circle fill=\"currentColor\" cx=\"16\" cy=\"16\" r=\"16\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-4 animate-fill\"/><path d=\"M64 16h48\" stroke=\"currentColor\" stroke-width=\"32\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-shape-index=\"1\" class=\"animation-delay-4 animation-duration-1 animate-stroke stroke-length-68\"/><circle fill=\"currentColor\" cx=\"16\" cy=\"64\" r=\"16\" data-shape-index=\"2\" class=\"animation-delay-5 animation-duration-4 animate-fill\"/><path d=\"M64 64h48\" stroke=\"currentColor\" stroke-width=\"32\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-shape-index=\"3\" class=\"animation-delay-9 animation-duration-1 animate-stroke stroke-length-68\"/><circle fill=\"currentColor\" cx=\"16\" cy=\"112\" r=\"16\" data-shape-index=\"4\" class=\"animation-delay-11 animation-duration-4 animate-fill\"/><path d=\"M64 112h48\" stroke=\"currentColor\" stroke-width=\"32\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-shape-index=\"5\" class=\"animation-delay-14 animation-duration-1 animate-stroke stroke-length-68\"/></g>"
},
"arty-stroke-16-panel-left": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M8 64l32 32\" stroke-linejoin=\"round\" data-shape-index=\"0\" class=\"animation-delay-11 animation-duration-3 animate-stroke stroke-length-68\"/><path d=\"M8 64l32-32\" stroke-linejoin=\"round\" data-shape-index=\"1\" class=\"animation-delay-11 animation-duration-3 animate-stroke stroke-length-68\"/><path d=\"M92 64H16\" data-shape-index=\"2\" class=\"animation-delay-7 animation-duration-5 animate-stroke stroke-length-102\"/><path d=\"M120 8v112\" stroke-linejoin=\"round\" data-shape-index=\"3\" class=\"animation-delay-0 animation-duration-7 animate-stroke stroke-length-153\"/></g>"
},
"arty-stroke-16-search": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M52 76L8 120\" data-shape-index=\"0\" class=\"animation-delay-10 animation-duration-3 animate-stroke stroke-length-102\"/><path d=\"M51.92 76.364C44.558 69.06 40 58.965 40 48 40 25.909 57.857 8 80 8s40 17.909 40 40-17.86 40-40 40c-11.186 0-20.866-4.48-28.08-11.636z\" data-shape-index=\"1\" class=\"animation-delay-0 animation-duration-10 animate-stroke stroke-length-345\"/></g>"
},
"arty-stroke-20-search": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M68 92L8 152\" data-shape-index=\"0\" class=\"animation-delay-10 animation-duration-3 animate-stroke stroke-length-102\"/><path d=\"M70.305 90.037C61.468 81.271 56 69.158 56 56c0-26.51 21.429-48 48-48s48 21.49 48 48-21.433 48-48 48c-13.423 0-25.039-5.376-33.695-13.963z\" data-shape-index=\"1\" class=\"animation-delay-0 animation-duration-10 animate-stroke stroke-length-345\"/></g>",
"width": 160,
"height": 160
},
"arty-stroke-24-close": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M8 8l176 176\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-6 animate-stroke stroke-length-345\"/><path d=\"M8 184L184 8\" data-shape-index=\"1\" class=\"animation-delay-6 animation-duration-6 animate-stroke stroke-length-345\"/></g>",
"width": 192,
"height": 192
},
"arty-stroke-24-confirm": {
"body": "<path d=\"M8 104l72 64L184 24\" stroke-linecap=\"round\" stroke-width=\"16\" stroke=\"currentColor\" stroke-linejoin=\"round\" fill=\"none\" fill-rule=\"evenodd\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-stroke stroke-length-345\"/>",
"width": 192,
"height": 192
},
"arty-stroke-24-drop-outline": {
"body": "<path d=\"M96 8S32 84 32 128c0 36 28 56 64 56s64-20 64-56C160 84 96 8 96 8z\" stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\" fill-rule=\"evenodd\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-10 animate-stroke stroke-length-500\"/>",
"width": 192,
"height": 192
},
"arty-stroke-24-drop": {
"body": "<g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M96 8S32 84 32 128c0 36 28 56 64 56s64-20 64-56C160 84 96 8 96 8z\" stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-9 animate-stroke stroke-length-500\"/><path d=\"M96 8S32 84 32 128c0 20.785 9.333 36.236 24.151 45.584l92.734-85.324C130.558 49.037 96 8 96 8z\" fill=\"currentColor\" data-shape-index=\"1\" class=\"animation-delay-9 animation-duration-4 animate-fill\"/></g>",
"width": 192,
"height": 192
},
"arty-stroke-24-filters": {
"body": "<g stroke=\"currentColor\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\"><path d=\"M32 8v72\" stroke-width=\"16\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-3 animate-stroke stroke-length-102\"/><path d=\"M32 136v48\" stroke-width=\"16\" data-shape-index=\"1\" class=\"animation-delay-3 animation-duration-2 animate-stroke stroke-length-68\"/><path d=\"M12 108h40\" stroke-width=\"24\" data-shape-index=\"2\" class=\"animation-delay-4 animation-duration-1 animate-stroke stroke-length-45\"/><path d=\"M96 8v24\" stroke-width=\"16\" data-shape-index=\"3\" class=\"animation-delay-6 animation-duration-1 animate-stroke stroke-length-30\"/><path d=\"M96 88v96\" stroke-width=\"16\" data-shape-index=\"4\" class=\"animation-delay-6 animation-duration-3 animate-stroke stroke-length-153\"/><path d=\"M76 60h40\" stroke-width=\"24\" data-shape-index=\"5\" class=\"animation-delay-10 animation-duration-1 animate-stroke stroke-length-45\"/><path d=\"M160 8v88\" stroke-width=\"16\" data-shape-index=\"6\" class=\"animation-delay-11 animation-duration-3 animate-stroke stroke-length-102\"/><path d=\"M160 152v32\" stroke-width=\"16\" data-shape-index=\"7\" class=\"animation-delay-14 animation-duration-1 animate-stroke stroke-length-45\"/><path d=\"M140 124h40\" stroke-width=\"24\" data-shape-index=\"8\" class=\"animation-delay-15 animation-duration-1 animate-stroke stroke-length-45\"/></g>",
"width": 192,
"height": 192
},
"arty-stroke-24-grid-3-outline": {
"body": "<g transform=\"translate(8 8)\" stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\" fill-rule=\"evenodd\"><circle cx=\"16\" cy=\"16\" r=\"16\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-2 animate-fill\"/><circle cx=\"88\" cy=\"16\" r=\"16\" data-shape-index=\"1\" class=\"animation-delay-2 animation-duration-2 animate-fill\"/><circle cx=\"160\" cy=\"16\" r=\"16\" data-shape-index=\"2\" class=\"animation-delay-4 animation-duration-2 animate-fill\"/><circle cx=\"16\" cy=\"88\" r=\"16\" data-shape-index=\"3\" class=\"animation-delay-6 animation-duration-2 animate-fill\"/><circle cx=\"88\" cy=\"88\" r=\"16\" data-shape-index=\"4\" class=\"animation-delay-7 animation-duration-2 animate-fill\"/><circle cx=\"160\" cy=\"88\" r=\"16\" data-shape-index=\"5\" class=\"animation-delay-9 animation-duration-2 animate-fill\"/><circle cx=\"16\" cy=\"160\" r=\"16\" data-shape-index=\"6\" class=\"animation-delay-11 animation-duration-2 animate-fill\"/><circle cx=\"88\" cy=\"160\" r=\"16\" data-shape-index=\"7\" class=\"animation-delay-13 animation-duration-2 animate-fill\"/><circle cx=\"160\" cy=\"160\" r=\"16\" data-shape-index=\"8\" class=\"animation-delay-15 animation-duration-2 animate-fill\"/></g>",
"width": 192,
"height": 192
},
"arty-stroke-24-grid-3": {
"body": "<g fill=\"currentColor\" fill-rule=\"evenodd\"><circle cx=\"24\" cy=\"24\" r=\"24\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-2 animate-fill\"/><circle cx=\"96\" cy=\"24\" r=\"24\" data-shape-index=\"1\" class=\"animation-delay-2 animation-duration-2 animate-fill\"/><circle cx=\"168\" cy=\"24\" r=\"24\" data-shape-index=\"2\" class=\"animation-delay-4 animation-duration-2 animate-fill\"/><circle cx=\"24\" cy=\"96\" r=\"24\" data-shape-index=\"3\" class=\"animation-delay-6 animation-duration-2 animate-fill\"/><circle cx=\"96\" cy=\"96\" r=\"24\" data-shape-index=\"4\" class=\"animation-delay-7 animation-duration-2 animate-fill\"/><circle cx=\"168\" cy=\"96\" r=\"24\" data-shape-index=\"5\" class=\"animation-delay-9 animation-duration-2 animate-fill\"/><circle cx=\"24\" cy=\"168\" r=\"24\" data-shape-index=\"6\" class=\"animation-delay-11 animation-duration-2 animate-fill\"/><circle cx=\"96\" cy=\"168\" r=\"24\" data-shape-index=\"7\" class=\"animation-delay-13 animation-duration-2 animate-fill\"/><circle cx=\"168\" cy=\"168\" r=\"24\" data-shape-index=\"8\" class=\"animation-delay-15 animation-duration-2 animate-fill\"/></g>",
"width": 192,
"height": 192
},
"arty-stroke-24-list-3-outline": {
"body": "<g transform=\"translate(8 8)\" stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><circle stroke-linejoin=\"round\" cx=\"16\" cy=\"16\" r=\"16\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-3 animate-fill\"/><rect x=\"72\" width=\"104\" height=\"32\" rx=\"16\" data-shape-index=\"1\" class=\"animation-delay-3 animation-duration-3 animate-fill\"/><circle stroke-linejoin=\"round\" cx=\"16\" cy=\"88\" r=\"16\" data-shape-index=\"2\" class=\"animation-delay-5 animation-duration-3 animate-fill\"/><rect x=\"72\" y=\"72\" width=\"104\" height=\"32\" rx=\"16\" data-shape-index=\"3\" class=\"animation-delay-8 animation-duration-3 animate-fill\"/><circle stroke-linejoin=\"round\" cx=\"16\" cy=\"160\" r=\"16\" data-shape-index=\"4\" class=\"animation-delay-11 animation-duration-3 animate-fill\"/><rect x=\"72\" y=\"144\" width=\"104\" height=\"32\" rx=\"16\" data-shape-index=\"5\" class=\"animation-delay-13 animation-duration-3 animate-fill\"/></g>",
"width": 192,
"height": 192
},
"arty-stroke-24-list-3": {
"body": "<g fill=\"none\" fill-rule=\"evenodd\"><circle fill=\"currentColor\" cx=\"24\" cy=\"24\" r=\"24\" data-shape-index=\"0\" class=\"animation-delay-0 animation-duration-4 animate-fill\"/><path d=\"M96 24h72\" stroke=\"currentColor\" stroke-width=\"48\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-shape-index=\"1\" class=\"animation-delay-4 animation-duration-1 animate-stroke stroke-length-102\"/><circle fill=\"currentColor\" cx=\"24\" cy=\"96\" r=\"24\" data-shape-index=\"2\" class=\"animation-delay-5 animation-duration-4 animate-fill\"/><path d=\"M96 96h72\" stroke=\"currentColor\" stroke-width=\"48\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-shape-index=\"3\" class=\"animation-delay-9 animation-duration-1 animate-stroke stroke-length-102\"/><circle fill=\"currentColor\" cx=\"24\" cy=\"168\" r=\"24\" data-shape-index=\"4\" class=\"animation-delay-11 animation-duration-4 animate-fill\"/><path d=\"M96 168h72\" stroke=\"currentColor\" stroke-width=\"48\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-shape-index=\"5\" class=\"animation-delay-14 animation-duration-1 animate-stroke stroke-length-102\"/></g>",
"width": 192,
"height": 192
},
"arty-stroke-24-search": {
"body": "<g stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M72 120L8 184\" data-shape-index=\"0\" class=\"animation-delay-11 animation-duration-2 animate-stroke stroke-length-102\"/><path d=\"M75.073 117.383C63.29 105.695 56 89.544 56 72c0-35.346 28.571-64 64-64s64 28.654 64 64c0 35.346-28.577 64-64 64-17.897 0-33.385-7.167-44.927-18.617z\" data-shape-index=\"1\" class=\"animation-delay-0 animation-duration-11 animate-stroke stroke-length-500\"/></g>",
"width": 192,
"height": 192
}
},
"aliases": {
"arty-stroke-16-arrow-right": {
"parent": "arty-stroke-16-arrow-left",
"hFlip": true
},
"arty-stroke-16-arrow-up": {
"parent": "arty-stroke-16-arrow-left",
"rotate": 1,
"vFlip": true
},
"arty-stroke-16-arrow-down": {
"parent": "arty-stroke-16-arrow-left",
"rotate": 3
},
"arty-stroke-16-arrows-from-2-corners-rotated": {
"parent": "arty-stroke-16-arrows-from-2-corners",
"hFlip": true
},
"arty-stroke-16-arrows-vertical": {
"parent": "arty-stroke-16-arrows-horizontal",
"rotate": 1
},
"arty-stroke-16-arrows-to-2-corners-rotated": {
"parent": "arty-stroke-16-arrows-to-2-corners",
"hFlip": true
},
"arty-stroke-16-caret-down-outline": {
"parent": "arty-stroke-16-caret-up-outline",
"vFlip": true
},
"arty-stroke-16-caret-left-outline": {
"parent": "arty-stroke-16-caret-up-outline",
"rotate": 1,
"vFlip": true
},
"arty-stroke-16-caret-right-outline": {
"parent": "arty-stroke-16-caret-up-outline",
"rotate": 1
},
"arty-stroke-16-caret-down": {
"parent": "arty-stroke-16-caret-up",
"vFlip": true
},
"arty-stroke-16-caret-left": {
"parent": "arty-stroke-16-caret-up",
"rotate": 1,
"vFlip": true
},
"arty-stroke-16-caret-right": {
"parent": "arty-stroke-16-caret-up",
"rotate": 1
},
"arty-stroke-16-carets-horizontal-outline": {
"parent": "arty-stroke-16-carets-vertical-outline",
"rotate": 3
},
"arty-stroke-16-carets-horizontal": {
"parent": "arty-stroke-16-carets-vertical",
"rotate": 3
},
"arty-stroke-16-chevron-right": {
"parent": "arty-stroke-16-chevron-left",
"hFlip": true
},
"arty-stroke-16-chevron-up": {
"parent": "arty-stroke-16-chevron-left",
"rotate": 1,
"vFlip": true
},
"arty-stroke-16-chevron-down": {
"parent": "arty-stroke-16-chevron-left",
"rotate": 3
},
"arty-stroke-16-double-arrow-vertical": {
"parent": "arty-stroke-16-double-arrow-horizontal",
"rotate": 1
},
"arty-stroke-16-filters-horizontal": {
"parent": "arty-stroke-16-filters",
"rotate": 3,
"hFlip": true
},
"arty-stroke-16-list-3-outline-rtl": {
"parent": "arty-stroke-16-list-3-outline",
"hFlip": true
},
"arty-stroke-16-list-3-rtl": {
"parent": "arty-stroke-16-list-3",
"hFlip": true
},
"arty-stroke-16-panel-right": {
"parent": "arty-stroke-16-panel-left",
"hFlip": true
},
"arty-stroke-16-panel-up": {
"parent": "arty-stroke-16-panel-left",
"rotate": 1,
"vFlip": true
},
"arty-stroke-16-panel-down": {
"parent": "arty-stroke-16-panel-left",
"rotate": 3
},
"arty-stroke-16-search-rotated": {
"parent": "arty-stroke-16-search",
"rotate": 3
},
"arty-stroke-20-search-rotated": {
"parent": "arty-stroke-20-search",
"rotate": 3
},
"arty-stroke-24-filters-horizontal": {
"parent": "arty-stroke-24-filters",
"rotate": 3,
"hFlip": true
},
"arty-stroke-24-list-3-outline-rtl": {
"parent": "arty-stroke-24-list-3-outline",
"hFlip": true
},
"arty-stroke-24-list-3-rtl": {
"parent": "arty-stroke-24-list-3",
"hFlip": true
},
"arty-stroke-24-search-rotated": {
"parent": "arty-stroke-24-search",
"rotate": 3
}
},
"width": 128,
"height": 128
}

21
license.txt Executable file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Vjacheslav Trushkin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "simple-svg-website-icons",
"version": "0.0.2",
"description": "Node.js version of icons.simplesvg.com",
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"author": "Vjacheslav Trushkin",
"license": "MIT",
"dependencies": {
"compression": "^1.6.2",
"express": "^4.15.2",
"simple-svg-cdn": "*",
"simple-svg-icons": "git+https://github.com/simplesvg/icons.git"
}
}

3
readme.md Normal file
View File

@ -0,0 +1,3 @@
# SimpleSVG icons website
This code runs on icons.simplesvg.com that is used to serve collections and SVG images.

26
ssl.js Normal file
View File

@ -0,0 +1,26 @@
/**
* Run this file instead of app.js if you want to enable SSL support
*/
"use strict";
const https = require('https'),
fs = require('fs');
let app = require('./app');
try {
let ssl = {
secureProtocol: 'SSLv23_method',
secureOptions: require('constants').SSL_OP_NO_SSLv3,
key: fs.readFileSync('ssl/ssl.key'),
cert: fs.readFileSync('ssl/ssl.crt'),
ca: fs.readFileSync('ssl/ssl.ca-bundle'),
};
let port = process.env.SSLPORT || 443;
https.createServer(ssl, app).listen(port);
console.log('Listening on port ' + port);
} catch (err) {
console.log('SSL certificates are missing');
}
module.exports = app;

7
ssl/readme.md Normal file
View File

@ -0,0 +1,7 @@
Put your SSL certificate here to enable SSL support.
Change file names to "ssl".
Files:
* ssl.key
* ssl.crt
* ssl.ca-bundle