Iconify API script. Search engine for icons, provides icon data on demand for icon components, dynamically generates SVG.
Go to file
Vjacheslav Trushkin 8fa0b50d96 Beta 5 2018-10-13 17:05:54 +03:00
json Update arty-animated collection, change simple-svg-icons dependency to npmjs 2018-02-05 20:39:02 +02:00
src Fix typo, execute rm to remove directory faster if possible 2018-10-13 17:05:30 +03:00
tests Rename few functions 2018-10-10 19:49:44 +03:00
.gitignore Functionality to synchronize collections from Git repository 2018-10-10 18:10:08 +03:00
.npmignore Functionality to synchronize collections from Git repository 2018-10-10 18:10:08 +03:00
app.js Log errors to email 2018-10-13 13:40:40 +03:00
app.yaml First public commit 2017-05-05 18:29:10 +03:00
config-default.json Fix typo, execute rm to remove directory faster if possible 2018-10-13 17:05:30 +03:00
config.md Log errors to email 2018-10-13 13:40:40 +03:00
license.txt First public commit 2017-05-05 18:29:10 +03:00
package-lock.json Log errors to email 2018-10-13 13:40:40 +03:00
package.json Beta 5 2018-10-13 17:05:54 +03:00
readme.md Update readme 2018-10-13 13:45:45 +03:00

readme.md

SimpleSVG icons website

This code runs on icons.simplesvg.com that is used to serve collections and SVG images.

PHP version is available at https://github.com/simplesvg/website-icons.php

How to use it

To start server simply run

node app

By default server will be running on port 3000. You can change port and other configuration by adding custom config.json

File config.json is the same as config-default.json, but contains only values you have customized. See config.md

It is better to run server on obscure port such as 3000 hidden behind firewall and use nginx reverse proxy. This way you can offload connection handling to nginx and you can easily use SSL, rate limiting and other security features nginx provides.

Node vs PHP

Node.js version of server is faster because it loads everything only once on startup. It is a bit harder to setup though because you need to install additional software and make sure server is running (using tools such as "pm2").

PHP process ends when HTTP request ends, so PHP has to reload lots of things for each request. PHP version has caching to minimize loading times, but it is still nowhere near as fast as Node.js version. The only upside of PHP version is it is easy to setup - simply upload files and you are done.

Node.js version has one feature that PHP version does not have: ability to send errors by email.

Use Node.js version if you can for better performance and better error reporting.